Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!decvax!cca!ima!inmet!root
From: root@inmet.UUCP
Newsgroups: net.notes
Subject: bug in 'buildmap' - (nf)
Message-ID: <1720@inmet.UUCP>
Date: Wed, 10-Oct-84 00:47:27 EDT
Article-I.D.: inmet.1720
Posted: Wed Oct 10 00:47:27 1984
Date-Received: Fri, 12-Oct-84 03:49:11 EDT
Lines: 20

#N:inmet:7400003:000:615
inmet!root    Oct  9 00:03:00 1984

Users of Jeff Donnely's "buildmap" program -- you're in for some
trouble with the latest usenet map -- it contains a one-letter
name which causes the hash function in lookup() to screw up:


    len = strlen (sys_name);
    hash = (sys_name[0] - '0');
    hash = hash * 75 + (sys_name[1] - '0');
    hash = hash * 75 + (sys_name[len-1] -'0');
	/* Notice that this one reaches into nowhere if len < 2  -- nrh */
    hash = hash * 75 + (sys_name[len-2] - '0');
    
The fix is to test to be sure that len > 1 before using a value
like sys_name[len -2].  Sometimes, ada'd be better....

					Nat Howard
					inmet!nrh