]> diplodocus.org Git - nmh/commit
mhlsbr.c: Don't strchr(3) non-string NUL-less buffer.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sun, 17 Sep 2017 12:19:40 +0000 (13:19 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sun, 17 Sep 2017 12:47:56 +0000 (13:47 +0100)
commit872ef4dde72a88ceb1358849a462f791135b842d
tree37878ceed7e8b8b73954d9b346055fd1db64bc0a
parent6fd323cc02e4e90d24e30b8c78a88a55e749556f
mhlsbr.c: Don't strchr(3) non-string NUL-less buffer.

Up to 8 KiB was read into a buffer and then strchr() used to test for a
linefeed.  There was no guarantee the linefeed would be present, else
why test for it, nor that the buffer would contain a NUL to terminate
the search, either from the read bytes, or the bytes not trampled by
read().  Replace the two similar lumps of code with a new
linefeed_typed().  Bug pre-dates git.
uip/mhlsbr.c