Ver Fonte

Bug fix in Win32 mg_mkdir

Sergey Lyubka há 12 anos atrás
pai
commit
d3005df019
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      mongoose.c

+ 1 - 1
mongoose.c

@@ -1169,7 +1169,7 @@ static int mg_mkdir(const char *path, int mode) {
   mg_strlcpy(buf, path, sizeof(buf));
   mg_strlcpy(buf, path, sizeof(buf));
   change_slashes_to_backslashes(buf);
   change_slashes_to_backslashes(buf);
 
 
-  (void) MultiByteToWideChar(CP_UTF8, 0, buf, -1, wbuf, sizeof(wbuf));
+  (void) MultiByteToWideChar(CP_UTF8, 0, buf, -1, wbuf, ARRAY_SIZE(wbuf));
 
 
   return CreateDirectoryW(wbuf, NULL) ? 0 : -1;
   return CreateDirectoryW(wbuf, NULL) ? 0 : -1;
 }
 }