bug in IntInf.scan StringCvt.HEX

Stephen Weeks sweeks@intertrust.com
Mon, 10 May 1999 18:11:24 -0700 (PDT)


Number: *
Title:       bug in IntInf.scan StringCvt.HEX
Keywords:    
Submitter:   Stephen Weeks <sweeks@acm.org>
Date:        05/10/99
Version:     110.9.1
System:      x86-linux
Severity:    
Problem:     

IntInf.scan StringCvt.HEX does not work correctly.  For example, the
result of scanning the string "0x1" should be 1, but instead 0 is
returned.  The scanner appears to be ignoring everything after the "0".

Code:        

let
   val str = "0x1"
   fun reader offset =
      if offset = size str
	 then NONE
      else SOME (String.sub(str, offset), offset + 1)
in IntInf.toString(#1(valOf(IntInf.scan StringCvt.HEX reader 0)))
end

Transcript:  
Comments:    
Fix:         
Test: *
Owner: *
Status: *