Explorar el Código

Fix fopen() in “a” (append) mode

fopen() does not work when file is opened in “a” (append) mode
nineisk hace 9 años
padre
commit
57af0d70d3
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      components/fatfs/src/vfs_fat.c

+ 1 - 1
components/fatfs/src/vfs_fat.c

@@ -152,7 +152,7 @@ static int fat_mode_conv(int m)
     }
     if ((m & O_CREAT) && (m & O_EXCL)) {
         res |= FA_CREATE_NEW;
-    } else if (m & O_CREAT) {
+    } else if ((m & O_CREAT) && (m & O_TRUNC)) {
         res |= FA_CREATE_ALWAYS;
     } else if (m & O_APPEND) {
         res |= FA_OPEN_ALWAYS;