[6880] in Athena Bugs
discuss 1.5a (RIOS port)
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Fri Jan 11 17:44:13 1991
Date: Fri, 11 Jan 91 17:43:14 -0500
To: bug-discuss@MIT.EDU, bugs@MIT.EDU
From: Richard Basch <probe@MIT.EDU>
The following change shows that there is a real bug... trying to list
the rel-eng meeting, transaction 2401, it caused the RS/6000 discuss
client to die. strncat() in this case was being passed a negative
value in client/list.c. Enclosed is a patch:
*** /tmp/,RCSt1000901 Fri Jan 11 17:39:54 1991
--- client/list.c Fri Jan 11 17:13:02 1991
***************
*** 77,83 ****
((t_infop->flags & TRN_FLAG1) != 0) ? "F" : "",
(t_infop->current == dsc_public.current) ? '*' : ' ');
(void) strncat (buffer, " ",
! MIN (5, 13-strlen (buffer)) - strlen (nlines));
if (strlen(t_infop->author) > 15)
(void) strcpy(&t_infop->author[12], "...");
--- 77,83 ----
((t_infop->flags & TRN_FLAG1) != 0) ? "F" : "",
(t_infop->current == dsc_public.current) ? '*' : ' ');
(void) strncat (buffer, " ",
! MAX(0,MIN (5, 13-strlen (buffer))-strlen (nlines)));
if (strlen(t_infop->author) > 15)
(void) strcpy(&t_infop->author[12], "...");
I think that one might want to change it so that you don't even do the
strncat if the MIN expression is less than zero. I am not entirely sure
that passing a value of zero is legal on all systems, either.
-Richard