Fix an off-by-one error that's already been accepted upstream
authorguenther <guenther@openbsd.org>
Mon, 14 Jul 2014 05:54:19 +0000 (05:54 +0000)
committerguenther <guenther@openbsd.org>
Mon, 14 Jul 2014 05:54:19 +0000 (05:54 +0000)
gnu/usr.bin/perl/x2p/str.c

index 86127a0..e12e5e9 100644 (file)
@@ -200,7 +200,7 @@ str_gets(STR *str, FILE *fp)
     for (;;) {
        while (--cnt >= 0) {
            if ((*bp++ = *ptr++) == newline) {
-               if (bp <= str->str_ptr || bp[-2] != '\\')
+               if (bp <= str->str_ptr + 1 || bp[-2] != '\\')
                    goto thats_all_folks;
                else {
                    line++;