Changeset 878
- Timestamp:
- 05/17/19 02:35:31 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/nonstd_stdio.cpp
r841 r878 303 303 { 304 304 int len = strlen(txt); 305 int res = mfwrite(txt, len, 1, f); 305 if (len==0) //when writing X 0-byte elements, fwrite() will return 0 ("0 elements written" instead of "X elements") but this is not an error 306 return 1; //for simplicity, we don't even try to write 0 bytes and report a success 307 int res = mfwrite(txt, len, 1, f); //write 1 element of len bytes 306 308 return res == 1 ? 1 : EOF; 307 309 }
Note: See TracChangeset
for help on using the changeset viewer.