Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!decvax!decwrl!ucbvax!tektools.tek.CSNET!bobp From: bobp@tektools.tek.CSNET.UUCP Newsgroups: mod.computers.vax Subject: Potential C problem Message-ID: <8606261652.AA25082@tektools.TEK> Date: Thu, 26-Jun-86 12:52:27 EDT Article-I.D.: tektools.8606261652.AA25082 Posted: Thu Jun 26 12:52:27 1986 Date-Received: Sat, 28-Jun-86 00:44:18 EDT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: Robert Perry Organization: Tektronix, Inc., Beaverton, OR. Lines: 44 Approved: info-vax@sri-kl.arpa Perhaps I missed something in the documentation, but can anyone tell me why the VMS C compiler doesn't allow a value of 0 in %x1 as in the following example ? ------------------------------------------------------------------- $! c sscanf/fscanf %x1 bug $cre bug.c #include main() { int c; int d; c=getc(stdin); if (sscanf(&c,"%x1",&d) == 0) printf("not a hex character\n"); else printf("hex character = %d\n",d); } $ $cc bug $link bug,sys$library:vaxcrtl/lib $run bug 1 $run bug f $run bug 0 $ ---------------------------------------------------------- -- Robert N. Perry (Bob) Tektronix, Inc. tektronix!tektools!bobp bobp%tektools@tektronix bobp%tektools@tektronix.csnet-relay bobp%tektools%tektronix@csnet-relay "When I works, I works hard. When I sits, I sits easy. When I thinks, I goes to sleep."