bug in fing.c
Charles Hedrick
hedrick at topaz.RUTGERS.EDU
Thu Sep 19 09:43:48 AEST 1985
We have found a portability problem in fing.c, which is a "front end"
to finger that knows about network connections. I would normally
report it directly to the author, cak, but I have been unable to
figure out which of the 50 *.purdue.edu machines to use. Anyway, in
fing.c, look for the first occurence of strcat. You will find a call
of the form
write (fd, strcat(user, "\r\n"), strlen(user) + 2);
This code seems to assume that arguments are evaluated right to
left. I believe that in C, evaluation order is undefined. At
any rate, it causes obscure symptoms on a Pyramid. I suggest
strcat(user, "\r\n");
write (fd, user, strlen(user));
which works fine on the Pyramid, and would seem to be portable.
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list