Firmware/FatFs: make f_gets break on NUL character as well

This commit is contained in:
Maximilian Rehkopf 2012-07-01 03:24:35 +02:00
parent 1be6885223
commit f4b8d57810

View File

@ -3644,6 +3644,7 @@ TCHAR* f_gets (
*p++ = c; *p++ = c;
n++; n++;
if (c == '\n') break; /* Break on EOL */ if (c == '\n') break; /* Break on EOL */
if (c == 0) break; /* Break on NUL */
} }
*p = 0; *p = 0;
return n ? buff : 0; /* When no data read (eof or error), return with error. */ return n ? buff : 0; /* When no data read (eof or error), return with error. */