From 1fb6f391a123cd3f186b7dad5ad0c1a5ff4ddef0 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Sun, 13 Jan 2013 10:55:42 +0000 Subject: [PATCH] In mg_upload(), use fopen() with "wb" mode instead of "wbx", cause "x" is not understood by Mac and Windows. --- mongoose.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mongoose.c b/mongoose.c index 9a23b320..b34d7721 100644 --- a/mongoose.c +++ b/mongoose.c @@ -4141,9 +4141,9 @@ int mg_upload(struct mg_connection *conn, const char *destination_dir) { if ((s = strrchr(fname, '/')) == NULL) { s = fname; } - // Open file in binary mode with exclusive lock set + // Open file in binary mode. TODO: set an exclusive lock. snprintf(path, sizeof(path), "%s/%s", destination_dir, s); - if ((fp = fopen(path, "wbx")) == NULL) { + if ((fp = fopen(path, "wb")) == NULL) { break; }