diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-04-12 18:31:48 +0200 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-04-12 18:31:48 +0200 |
commit | cc49f1e2628d345c784dac24fe94bcb3445d4c8d (patch) | |
tree | 7017051e7186262c2e1c883ca879ca0ee2f14108 /src/io.c | |
parent | 57b62a1e49c21143fe977bbefc0a0090791d996d (diff) | |
download | calcurse-cc49f1e2628d345c784dac24fe94bcb3445d4c8d.zip |
Fix io_file_is_empty() behaviour when file starts with a newline.
Read second byte if the first byte is a newline character to ensure the
file doesn't contain any further data.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/io.c')
-rw-r--r-- | src/io.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3051,7 +3051,7 @@ io_file_is_empty (char *file) if (file && (fp = fopen (file, "r"))) { - if (fgetc (fp) == '\n' || feof (fp)) + if ((fgetc (fp) == '\n' && fgetc (fp) == EOF) || feof (fp)) { fclose (fp); return 1; |