<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">https://bugs.gentoo.org/show_bug.cgi?id=566050#c2

--- a/src/paps.c
+++ b/src/paps.c
@@ -569,11 +569,14 @@
 
   fclose (file);
 
-  /* Add a trailing new line if it is missing */
-  if (inbuf-&gt;str[inbuf-&gt;len-1] != '\n')
-    g_string_append(inbuf, "\n");
+  if (inbuf-&gt;len) {
+	  /* Add a trailing new line if it is missing */
+	  if (inbuf-&gt;str[inbuf-&gt;len-1] != '\n')
+	    g_string_append(inbuf, "\n");
 
-  text = inbuf-&gt;str;
+	  text = inbuf-&gt;str;
+  } else
+  	text = g_strdup("\n");
   g_string_free (inbuf, FALSE);
 
   return text;
</pre></body></html>