]> diplodocus.org Git - nmh/commitdiff
mhical expected an ics file as input and after just pressing
authorLeonardo Taccari <iamleot@gmail.com>
Thu, 17 Aug 2017 23:42:48 +0000 (19:42 -0400)
committerDavid Levine <levinedl@acm.org>
Thu, 17 Aug 2017 23:42:48 +0000 (19:42 -0400)
^D I've found that mhical wasn't happy about an empty input.
A trivial patch that should fix this issue.

test/mhical/test-mhical
uip/mhical.c

index 930c35f..ad51b09 100755 (executable)
@@ -874,5 +874,10 @@ check "$expected" "$actual"
 check "$expected_err" "$actual_err"
 
 
+# check null input
+start_test "null input"
+check_exit '-eq 0' mhical </dev/null
+
+
 finish_test
 exit $failed
index 650b982..1567d3a 100644 (file)
@@ -714,7 +714,7 @@ display (FILE *file, contentline *clines, char *nfs) {
     }
 
     /* Don't call on the END:VCALENDAR line. */
-    if (clines->next) {
+    if (clines  &&  clines->next) {
       (void) fmt_scan (fmt, buffer, INT_MAX, dat, NULL);
       fputs (charstring_buffer (buffer), file);
       fmt_free (fmt, 1);