summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--note.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/note.c b/note.c
index 3cca833..4883be1 100644
--- a/note.c
+++ b/note.c
@@ -76,7 +76,9 @@ last(char *fullpath)
}
fseek(fp, 0, SEEK_END);
- pos = ftell(fp);
+
+ if (!(pos = ftell(fp)))
+ exit(0);
while (1) {
fseek(fp, --pos, SEEK_SET);