Well, it's always a bad idea to introduce new bugs when trying to fix

one... strncat(3) takes a string as its second arg, and a len as its
third one, not the other way round. =:-)

The ``consistency'' of the C library sucks, of course.
This commit is contained in:
Joerg Wunsch 1998-06-28 08:04:07 +00:00
parent b85e95f56a
commit 51b8ca739a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=11573

View File

@ -45,7 +45,7 @@
/* Append the <CR><LF> */
- (void)strcat(message, "\r\n");
+ len -= strlen(message);
+ (void)strncat(message, len, "\r\n");
+ (void)strncat(message, "\r\n", len);
/* Send the message to the client */
(void)fputs(message,p->output);