From: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
To: linux-kernel@vger.kernel.org
Subject: (v)sscanf handles %i improperly (+patch)
Date: Mon, 07 Jan 2002 23:27:04 +0200 [thread overview]
Message-ID: <3C3A12A8.3010000@intel.com> (raw)
Sorry for 2-nd posting, but I'm afraid 1-st one was lost. Or is the
issue itself not relevant? Anyway,
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;
next reply other threads:[~2002-01-07 21:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-07 21:27 Vladimir Kondratiev [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-12-25 21:46 (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=3C3A12A8.3010000@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox