[comp.sys.amiga.tech] Manx 5.0 Scanf problem

tam2744@ultb.isc.rit.edu (T.A. Mikalsen) (03/13/90)

    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.

tam2744@ultb.isc.rit.edu (T.A. Mikalsen) (03/13/90)

    This is a correction to my previous note about scanf.  The 
    example I gave had a mistake.  The %w in the format string should
    actually be a %x.