All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
To: linux-kernel@vger.kernel.org
Subject: (v)sscanf handles %i improperly (+patch)
Date: Tue, 25 Dec 2001 23:46:12 +0200	[thread overview]
Message-ID: <3C28F3A4.4010808@intel.com> (raw)

I found (v)sscanf included in last kernels handles %i format improperly. 
Currently, up to 2.4.17, %i is handled identical to %d. However, 
accordingly to man for sscanf,

       i      Matches an  optionally  signed  integer;  the  next
              pointer  must  be a pointer to int.  The integer is
              read in base 16 if it begins with `0x' or `0X',  in
              base 8 if it begins with `0', and in base 10 other­
              wise.  Only characters that correspond to the  base
              are used.

Please, when replying, CC me: mailto:vladimir.kondratiev@intel.com

Patch is quite small (against 2.4.17):

--- vsprintf.c.orig    Thu Oct 11 20:17:22 2001
+++ vsprintf.c    Tue Dec 25 23:29:31 2001
@@ -616,8 +616,9 @@
         case 'X':
             base = 16;
             break;
-        case 'd':
         case 'i':
+            base = 0; /* autodetect */
+        case 'd':
             is_sign = 1;
         case 'u':
             break;



             reply	other threads:[~2001-12-25 21:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-25 21:46 Vladimir Kondratiev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-01-07 21:27 (v)sscanf handles %i improperly (+patch) Vladimir Kondratiev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C28F3A4.4010808@intel.com \
    --to=vladimir.kondratiev@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.