Article View: comp.bugs.4bsd
Article #9Bug in "comm" utility
From: Doug Gwyn
Date: Tue, 13 Jun 1989 15:53
Date: Tue, 13 Jun 1989 15:53
23 lines
916 bytes
916 bytes
As you can see in the excerpt below, the UNIX "comm" utility makes a
non-portable assumption about pointer arithmetic in its compare() function.
Here is the quick fix I devised for the UNIX System V Release 2.0 source;
other versions of "comm" appear to be similar.
static char sccsid[] = "@(#)comm.c 1.2";
...
main(argc,argv)
char **argv;
{
int l;
char xlb1[LB+1],xlb2[LB+1]; /* DAG: allow for -- in compare() */
#define lb1 (&xlb1[1])
#define lb2 (&xlb2[1])
...
compare(a,b)
char *a,*b;
{
register char *ra,*rb;
ra = --a;
rb = --b;
...
Technical Details
Message-ID:
<10396@smoke.BRL.MIL>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cmcl2!adm!smoke!gwynShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.bugs.4bsd,comp.bugs.sys5 Subject: Bug in "comm" utility Keywords: UNIX "comm" bug fix Message-ID: <10396@smoke.BRL.MIL> Date: 13 Jun 89 15:53:14 GMT Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 23