Path: utzoo!attcan!uunet!lll-winken!unixhub!shelby!neon!Gang-of-Four!dkeisen From: dkeisen@Gang-of-Four.Stanford.EDU (Dave Eisen) Newsgroups: comp.lang.c Subject: Re: Converting ascii hex values to hex bytes Message-ID: <1990Oct17.183422.8553@Neon.Stanford.EDU> Date: 17 Oct 90 18:34:22 GMT References: <298@cti1.UUCP> <1990Oct17.162529.20096@Neon.Stanford.EDU> Sender: news@Neon.Stanford.EDU (USENET News System) Distribution: comp Organization: Sequoia Peripherals Lines: 27 In article <1990Oct17.162529.20096@Neon.Stanford.EDU> dkeisen@Gang-of-Four.Stanford.EDU (Dave Eisen) writes: That idiot Eisen had what appears to be a typo in his code: int convert_data (const char *ascii, char *four_bytes) { char *p; int bytenum; for (bytenum = 0, p = ascii; bytenum < 4; bytenum++) { four_bytes[bytenum] = atoi (p); if ((p = strchr (p, '.')) == NULL) /* strchr is called index in BSD */ return -1; p++; /* Omitted in the original posting */ } return 0; } -- Dave Eisen Home: (415) 323-9757 dkeisen@Gang-of-Four.Stanford.EDU Office: (415) 967-5644 1447 N. Shoreline Blvd. Mountain View, CA 94043