
		39) TABS in L.sys Break things

From: tektronix!decvax!cca!hartwell%Shasta@SU-Score@sri-unix
Date: Tue Dec  7 19:56:39 1982
Subject: uucp(versys.c) bug
Newsgroups: net.unix-wizards

From: Steve Hartwell <hartwell%Shasta at SU-Score>
Date: Wednesday,  1 Dec 1982 14:28-PST
in versys.c, while reading from the L.sys file, right after the fgets(line...,
there is a line:
	*(index(line, ' ')) = '\0';

If the L.sys line does not terminate the system name with a blank (i.e., with
a tab (\t) instead), this will cause a core dump on some systems.
Index should never be used 'blindly', I have learned.

This line, and the "line[7] = '\0'" statement below it can be replaced with
the statement:
	sscanf(line, "%7s", line);

I frequently use sscanf to do string parsing for me.  This will guarantee that
the string is null-terminated and at most 7 characters long.

Apologies if this bug has already been reported.

Steve Hartwell

