Menu

#14 STAFStringToUInt() does not handle numbers above base 10

STAF V3.1.5
closed-fixed
5
2006-08-02
2006-08-02
No

The function STAFStringToUInt() was written to handle
numbers other than base 10. However, there is a
minor bug which prevents it from handling anything
above base 10.

Line 913:

dig = *ptr - 0x57; // A = 10, B = 11, ... and so on

should be changed to:

dig = (*ptr | 0x20) - 0x57; // A = 10, B = 11, ...

otherwise the unsigned int "dig" is set to a negative
value. Correction is supplied in the attached file.

Discussion

  • Scott Kukshtel

    Scott Kukshtel - 2006-08-02

    STAFString.cpp

     
  • Sharon Lucas

    Sharon Lucas - 2006-08-02

    Logged In: YES
    user_id=285070

    Thank you for submitting this patch.

     
  • Sharon Lucas

    Sharon Lucas - 2006-08-02
    • assigned_to: nobody --> slucas
     
  • Sharon Lucas

    Sharon Lucas - 2006-08-02

    Logged In: YES
    user_id=285070

    Implemented this patch via Bug #1533482.

    This fix will be in the next release of STAF (V3.1.5).

     
  • Sharon Lucas

    Sharon Lucas - 2006-08-02
    • labels: --> Lang:: C/C++
    • milestone: 611996 --> STAF V3.1.5
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB