-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
Lines 1619 to 1634 in c50d4c3
| int write_history(const char *filename) | |
| { | |
| FILE *fp; | |
| int i = 0; | |
| hist_alloc(); | |
| fp = fopen(filename, "w"); | |
| if (!fp) | |
| return EOF; | |
| while (i < H.Size) | |
| fprintf(fp, "%s\n", H.Lines[i++]); | |
| return fclose(fp); | |
| } |
Note that fprintf has no check on its return value so it could fail without being reported. I am unsure if the IO errors turn the FILE * into some poison that would cause the fclose() to fail, but somehow I suspect they would not.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels