]> git.ozlabs.org Git - petitboot/blobdiff - lib/fold/fold.c
discover/status: remove completion messages
[petitboot] / lib / fold / fold.c
index 2566253aca8de697149d2c17477eb26ba14b455a..812a324839223df6fd43af74f5549754fb6a0146 100644 (file)
@@ -36,9 +36,10 @@ void fold_text(const char *text,
 
                assert(bytes != (size_t)-1);
 
-               /* we'll get a zero size for the nul terminator, or (size_t) -2
-                * if we've reached the end of the buffer */
-               if (!bytes || bytes == (size_t) -2) {
+               /* we'll get a zero size for the nul terminator, (size_t) -2
+                * if we've reached the end of the buffer, or (size_t) -1 on
+                * error */
+               if (!bytes || bytes == (size_t) -2 || bytes == (size_t) -1) {
                        line_cb(arg, start, end - start);
                        break;
                }