mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marc-Christian Petersen <m.c.p@wolk-project.de>
To: Torsten Foertsch <torsten.foertsch@gmx.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] vsscanf do not convert hex numbers starting with a non-digit
Date: Tue, 11 Mar 2003 12:36:15 +0100	[thread overview]
Message-ID: <200303111236.15944.m.c.p@wolk-project.de> (raw)
In-Reply-To: <200303111202.19984.torsten.foertsch@gmx.net>

On Tuesday 11 March 2003 12:02, Torsten Foertsch wrote:

Hi Torsten,


> I found the following little bug in 2.4.19. I did not try newer kernels.
> vsscanf refuses to convert a hex number starting with a nondecimal digit
> like:
> char *buf="ff";
> unsigned ff=0;
> sscanf( buf, "%x", &ff );      /* fails: nothing is converted */
>
> Here is a patch that corrects that behaviour:
>
> --- linux/lib/vsprintf.c        2001-10-11 20:17:22.000000000 +0200
> +++ linux.patched/lib/vsprintf.c        2003-03-11 11:52:08.000000000 +0100
> @@ -637,7 +637,7 @@
>                 while (isspace(*str))
>                         str++;
>
> -               if (!*str || !isdigit(*str))
> +               if (!*str || !(isdigit(*str) || (base==16 &&
> isxdigit(*str)))) break;
>
>                 switch(qualifier) {

http://marc.theaimsgroup.com/?l=linux-kernel&m=104687957102846&w=2

This fix was first posted since early 2.4.18-pre stage.

ciao, Marc



      reply	other threads:[~2003-03-11 11:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-11 11:02 Torsten Foertsch
2003-03-11 11:36 ` Marc-Christian Petersen [this message]

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=200303111236.15944.m.c.p@wolk-project.de \
    --to=m.c.p@wolk-project.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torsten.foertsch@gmx.net \
    /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

all inboxes | Powered by JetHome®