Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!amdahl!pyramid!prls!philabs!micomvax!vedge!lai From: lai@vedge.UUCP (David Lai) Newsgroups: comp.bugs.misc Subject: Re: shar2 Summary: argv access bug Message-ID: <344@vedge.UUCP> Date: 26 May 88 15:41:39 GMT Reply-To: lai@vedge.UUCP (David Lai) Organization: Visual Edge Software, St. Laurent, PQ Lines: 22 Posted: Thu May 26 11:41:39 1988 References: Keywords: In the recent posting of shar2, there is a minor bug which may cause segmentation faults on some machines. In the file shar2.c, in procedure main, there is the statement: while (argv[1][0] == '-') is executed without checking to see if argc==1 (no args on the command line), causing a dump. The fix is to move the lines (which appear later in main): if (argc == 1) { fprintf (stderr, "%s: No input files\n", SHAR); helpuser (); exit (1); } up to the top of main before while (argv[1][0] == '-') -- "What is a DJ if he can't scratch?" - Uncle Jamms Army The views expressed are those of the author, and not of Visual Edge, nor Usenet. David Lai (vedge!lai@larry.mcrcim.mcgill.edu || ...watmath!onfcanim!vedge!lai)