[lkml]   [2003]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [PATCH] Fix %x parsing in vsscanf()
    On Tue, Sep 23, 2003 at 02:22:07PM -0700, Deepak Saxena wrote:
    > The existing code in kernel/vsprintf.c:vsscanf() does not properly
    > handle the case where the format is specfied as %x or %X and the
    > string contains the number in the format "0xinteger". Instead of
    > reading "0xinteger", the code currently only sees the '0' and treats
    > the 'x' as a delimiter. Following patch (against 2.4 and 2.6) fixes
    > this. Another option is to put the check in simple_strtoul() and
    > simple_strtoull() if that is preferred. I like this better b/c
    > we only have the check once.

    We should put that into strtoul(). Rationale:

    If the value of base is 16, the characters 0x or 0X may optionally precede
    the sequence of letters and digits, following the sign if present.

    That's from C99 (definition of strtoul and friends) and it does
    match the normal userland behaviour of strtoul(3) on all platforms I'd
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:48    [W:0.020 / U:48.696 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site