From: David Levine Date: Sat, 12 Jan 2013 17:14:45 +0000 (-0600) Subject: Removed "sleazy hack" of negative bufsz because commit X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/8c160c7faebe3cd161d7aad3f2b22f2a117dbb3f?hp=--cc Removed "sleazy hack" of negative bufsz because commit 05d8af21d26673279a1ca079ad9c6f301426fe0e removed the only use of it. --- 8c160c7faebe3cd161d7aad3f2b22f2a117dbb3f diff --git a/sbr/m_getfld.c b/sbr/m_getfld.c index a98732be..ef5365a1 100644 --- a/sbr/m_getfld.c +++ b/sbr/m_getfld.c @@ -477,11 +477,9 @@ m_getfld (int state, unsigned char name[NAMESZ], unsigned char *buf, body: /* * get the message body up to bufsz characters or the - * end of the message. Sleazy hack: if bufsz is negative - * we assume that we were called to copy directly into - * the output buffer and we don't add an eos. + * end of the message. */ - i = (*bufsz < 0) ? -*bufsz : *bufsz-1; + i = *bufsz-1; /* Back up and store the current position and update cnt. */ bp = --m.readpos; cnt = m.end - m.readpos; @@ -558,10 +556,6 @@ m_getfld (int state, unsigned char name[NAMESZ], unsigned char *buf, c is less than or equal to the number of bytes remaining in the read buffer, so will not overrun it. */ m.readpos += c; - if (*bufsz < 0) { - *bufsz = c + bytes_read + 1; - return (state); - } cp = buf + c; break;