bytes which aren't valid runes are not part of a sequence of printable
characters and shouldn't be skipped over.
---
 strings.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/strings.c b/strings.c
index da25f9f..930d4cc 100644
--- a/strings.c
+++ b/strings.c
@@ -20,9 +20,7 @@ strings(FILE *fp, const char *fname, size_t min)
 
        for (off = 0, start = 0, i = 0; (bread = efgetrune(&r, fp, fname)); ) {
                off += bread;
-               if (r == Runeerror)
-                       continue;
-               if (!isprintrune(r)) {
+               if (r == Runeerror || !isprintrune(r)) {
                        if (i == min)
                                putchar('\n');
                        start = off;
-- 
2.31.1


Reply via email to