Article View: comp.sys.amiga.tech
Article #2940Manx 5.0 Scanf problem
From: T.A. Mikalsen
Date: Mon, 12 Mar 1990 19:09
Date: Mon, 12 Mar 1990 19:09
21 lines
1093 bytes
1093 bytes
There seems to be a problem with the Manx 5.0 scanf library
call. If this problem has already been discussed, sorry.
The problem occurs when reading hex values with leading zeros.
Scanf sees the leading zeros and says "It must be an octal
number" and reads it as such. It dosn't even report a
conversion error.
Here is some example code:
ok = scanf("%w",&fred);
if(ok!=1)
puts("Conversion error");
printf("%x\n",fred);
Input data of 032 gives output of 1a: 032 was read as an octal.
On Unix and the old compiler (Manx 3.6) I get the correct output.
tom.
Technical Details
Message-ID:
<2417@ultb.isc.rit.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!elroy.jpl.nasa.gov!peregrine!ccicpg!cci632!rit!ultb!tam2744Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!elroy.jpl.nasa.gov!peregrine!ccicpg!cci632!rit!ultb!tam2744 From: tam2744@ultb.isc.rit.edu (T.A. Mikalsen) Newsgroups: comp.sys.amiga.tech Subject: Manx 5.0 Scanf problem Message-ID: <2417@ultb.isc.rit.edu> Date: 12 Mar 90 19:09:29 GMT Reply-To: tam2744@ultb.isc.rit.edu (T.A. Mikalsen) Distribution: usa Organization: Rochester Institute of Technology, Information Systems Lines: 21