If chomp() needs to test it found \n, should also test it's at end of string.
diff --git a/lib/lib.c b/lib/lib.c
index aa7b1c3..b370305 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -342,11 +342,12 @@
   return try;
 }
 
+// Remove trailing \n
 char *chomp(char *s)
 {
   char *p = strrchr(s, '\n');
 
-  if (p) *p = 0;
+  if (p && !p[1]) *p = 0;
   return s;
 }