]> diplodocus.org Git - nmh/commitdiff
Corrected fseek() emulation to fix test/bad-input/test-header.
authorDavid Levine <levinedl@acm.org>
Thu, 27 Dec 2012 19:53:33 +0000 (13:53 -0600)
committerDavid Levine <levinedl@acm.org>
Thu, 27 Dec 2012 19:53:33 +0000 (13:53 -0600)
sbr/m_getfld.c

index c8a2d8b8274fe7d5f7929f4c48f520fe8cab895a..577030c132ce7ecc3f7d47bf0285932fd08fa9f9 100644 (file)
@@ -409,7 +409,7 @@ m_getfld (int state, unsigned char name[NAMESZ], unsigned char *buf,
                     * get extra newlines, but that should be harmless enough,
                     * right?  This is a corrupt message anyway. */
                    /* emulates:  fseek (iob, ftell (iob) -2), SEEK_SET) */
                     * get extra newlines, but that should be harmless enough,
                     * right?  This is a corrupt message anyway. */
                    /* emulates:  fseek (iob, ftell (iob) -2), SEEK_SET) */
-                   m.readpos += cnt - 1;
+                   m.readpos -= 2;
                    *bufsz = bytes_read;
                    return BODY;
                }
                    *bufsz = bytes_read;
                    return BODY;
                }