All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] PATCH-add "0X" hexadecimal prefix to simple_strtoul
@ 2011-02-08 16:38 Rob Alexander
  2011-02-08 19:14 ` Wolfgang Denk
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Alexander @ 2011-02-08 16:38 UTC (permalink / raw)
  To: u-boot

Added support to simple_strtoul to support the standard 0X hex notation. This issue
was causing operational bug in U-boot console commands where "0X" hex numbers were being
misinterpreted as decimal.

Signed-off-by: Rob Alexander<robert.b.alexander@motorola.com>
--- vsprintf.org.c	2011-02-08 10:12:35.954644500 -0600
+++ vsprintf.c	2011-02-08 10:26:01.708224300 -0600
@@ -41,8 +41,9 @@
  	unsigned long result = 0,value;

  	if (*cp == '0') {
-		cp++;
-		if ((*cp == 'x')&&  isxdigit(cp[1])) {
+		cp++;
+		//support both 0X and 0x notation
+		if ((tolower(*cp) == 'x')&&  isxdigit(cp[1])) {
  			base = 16;
  			cp++;
  		}
@@ -99,7 +100,8 @@

  	if (*cp == '0') {
  		cp++;
-		if ((*cp == 'x')&&  isxdigit (cp[1])) {
+    //support both 0X and 0x notation
+		if ((tolower(*cp) == 'x')&&  isxdigit(cp[1]))
  			base = 16;
  			cp++;
  		}

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] PATCH-add "0X" hexadecimal prefix to simple_strtoul
  2011-02-08 16:38 [U-Boot] PATCH-add "0X" hexadecimal prefix to simple_strtoul Rob Alexander
@ 2011-02-08 19:14 ` Wolfgang Denk
  2011-02-09  6:19   ` Chris Moore
  0 siblings, 1 reply; 8+ messages in thread
From: Wolfgang Denk @ 2011-02-08 19:14 UTC (permalink / raw)
  To: u-boot

Dear Rob Alexander,

In message <4D51716D.3060002@motorola.com> you wrote:
> Added support to simple_strtoul to support the standard 0X hex notation. This issue
> was causing operational bug in U-boot console commands where "0X" hex numbers were being
> misinterpreted as decimal.

Can you please provide an example where such problems happened?

> Signed-off-by: Rob Alexander<robert.b.alexander@motorola.com>
> --- vsprintf.org.c	2011-02-08 10:12:35.954644500 -0600
> +++ vsprintf.c	2011-02-08 10:26:01.708224300 -0600
> @@ -41,8 +41,9 @@
>   	unsigned long result = 0,value;
> 
>   	if (*cp == '0') {
> -		cp++;
> -		if ((*cp == 'x')&&  isxdigit(cp[1])) {
> +		cp++;
> +		//support both 0X and 0x notation

ERROR: do not use C99 // comments

> +		if ((tolower(*cp) == 'x')&&  isxdigit(cp[1])) {

ERROR: spaces required around that '&&' (ctx:VxW)

>   			base = 16;
>   			cp++;
>   		}
> @@ -99,7 +100,8 @@
> 
>   	if (*cp == '0') {
>   		cp++;
> -		if ((*cp == 'x')&&  isxdigit (cp[1])) {
> +    //support both 0X and 0x notation
> +		if ((tolower(*cp) == 'x')&&  isxdigit(cp[1]))

Ditto.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Reader, suppose you were an idiot. And suppose you were a  member  of
Congress. But I repeat myself.                           - Mark Twain

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] PATCH-add "0X" hexadecimal prefix to simple_strtoul
  2011-02-08 19:14 ` Wolfgang Denk
@ 2011-02-09  6:19   ` Chris Moore
  2011-02-09  6:40     ` Albert ARIBAUD
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Moore @ 2011-02-09  6:19 UTC (permalink / raw)
  To: u-boot

Hi,

Le 08/02/2011 20:14, Wolfgang Denk a ?crit :
> Dear Rob Alexander,
>
> In message<4D51716D.3060002@motorola.com>  you wrote:
>
>> +		if ((tolower(*cp) == 'x')&&   isxdigit(cp[1])) {
> ERROR: spaces required around that '&&' (ctx:VxW)
>

I suspect that this could be the Thunderbird problem that Albert noticed 
the other day.
Some versions of TB seem to eat the space before an '&' character and 
IIRC also before at least one of the '<' and '>' characters :(

I also noticed this in some of my (rare) posts.
I am using TB 3.1.5.
I am too ashamed to admit my OS ;-)

A nonsense test case written with correct spacing: a = (b > (c >> 1)) && 
((d < ((e & 1) << 1)));
If you receive this correctly then please excuse me for the noise :(

Cheers,
Chris

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] PATCH-add "0X" hexadecimal prefix to simple_strtoul
  2011-02-09  6:19   ` Chris Moore
@ 2011-02-09  6:40     ` Albert ARIBAUD
  2011-02-09 21:17       ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: Albert ARIBAUD @ 2011-02-09  6:40 UTC (permalink / raw)
  To: u-boot

Le 09/02/2011 07:19, Chris Moore a ?crit :
> Hi,
>
> Le 08/02/2011 20:14, Wolfgang Denk a ?crit :
>> Dear Rob Alexander,
>>
>> In message<4D51716D.3060002@motorola.com> you wrote:
>>
>>> + if ((tolower(*cp) == 'x')&& isxdigit(cp[1])) {
>> ERROR: spaces required around that '&&' (ctx:VxW)
>>
>
> I suspect that this could be the Thunderbird problem that Albert noticed
> the other day.
> Some versions of TB seem to eat the space before an '&' character and
> IIRC also before at least one of the '<' and '>' characters :(

Not only. From time to time I see spaces missing between simple words in 
the subjects pane of the UI while the actual message does have the 
space, meaning TB wrongly removes spaces at the receiving end, not the 
sending end.

> I also noticed this in some of my (rare) posts.
> I am using TB 3.1.5.
> I am too ashamed to admit my OS ;-)
>
> A nonsense test case written with correct spacing: a = (b > (c >> 1)) &&
> ((d < ((e & 1) << 1)));
> If you receive this correctly then please excuse me for the noise :(

Received correctly. :)

In Rob's case I am not sure that the issue is due to TB eating selected 
spaces upon reception; my own TB (3.1.7), using ^U to display the raw 
message from Rob, shows missing spaces are actually in what was sent, 
and I think Wolfgang does not use TB at all.

Amicalement,
-- 
Albert.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] PATCH-add "0X" hexadecimal prefix to simple_strtoul
  2011-02-09  6:40     ` Albert ARIBAUD
@ 2011-02-09 21:17       ` Scott Wood
  2011-02-10  6:16         ` [U-Boot] Thunderbird bug (was PATCH-add "0X" hexadecimal prefix to simple_strtoul) Chris Moore
  0 siblings, 1 reply; 8+ messages in thread
From: Scott Wood @ 2011-02-09 21:17 UTC (permalink / raw)
  To: u-boot

On Wed, 9 Feb 2011 07:40:44 +0100
Albert ARIBAUD <albert.aribaud@free.fr> wrote:

> Le 09/02/2011 07:19, Chris Moore a ?crit :
> > I also noticed this in some of my (rare) posts.
> > I am using TB 3.1.5.
> > I am too ashamed to admit my OS ;-)
> >
> > A nonsense test case written with correct spacing: a = (b > (c >> 1)) &&
> > ((d < ((e & 1) << 1)));
> > If you receive this correctly then please excuse me for the noise :(
> 
> Received correctly. :)
> 
> In Rob's case I am not sure that the issue is due to TB eating selected 
> spaces upon reception; my own TB (3.1.7), using ^U to display the raw 
> message from Rob, shows missing spaces are actually in what was sent, 
> and I think Wolfgang does not use TB at all.

It's when quoting a message for a reply that Thunderbird does this mangling.

-Scott

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] Thunderbird bug (was PATCH-add "0X" hexadecimal prefix to simple_strtoul)
  2011-02-09 21:17       ` Scott Wood
@ 2011-02-10  6:16         ` Chris Moore
  2011-02-10  6:22           ` Chris Moore
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Moore @ 2011-02-10  6:16 UTC (permalink / raw)
  To: u-boot

Hi,

Le 09/02/2011 22:17, Scott Wood a ?crit :
> On Wed, 9 Feb 2011 07:40:44 +0100
> Albert ARIBAUD<albert.aribaud@free.fr>  wrote:
>
>> Le 09/02/2011 07:19, Chris Moore a ?crit :
>>> I also noticed this in some of my (rare) posts.
>>> I am using TB 3.1.5.
>>> I am too ashamed to admit my OS ;-)
>>>
>>> A nonsense test case written with correct spacing: a = (b>  (c>>  1))&&
>>> ((d<  ((e&  1)<<  1)));
>>> If you receive this correctly then please excuse me for the noise :(
>> Received correctly. :)
>>
>> In Rob's case I am not sure that the issue is due to TB eating selected
>> spaces upon reception; my own TB (3.1.7), using ^U to display the raw
>> message from Rob, shows missing spaces are actually in what was sent,
>> and I think Wolfgang does not use TB at all.
> It's when quoting a message for a reply that Thunderbird does this mangling.
>

Right, that would seem to be this bug: 
https://bugzilla.mozilla.org/show_bug.cgi?id=448198
I have certainly encountered this one when quoting :(

But there is also: https://bugzilla.mozilla.org/show_bug.cgi?id=597181
I wonder if I haven't run into this one too :(

Cheers,
Chris

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] Thunderbird bug (was PATCH-add "0X" hexadecimal prefix to simple_strtoul)
  2011-02-10  6:16         ` [U-Boot] Thunderbird bug (was PATCH-add "0X" hexadecimal prefix to simple_strtoul) Chris Moore
@ 2011-02-10  6:22           ` Chris Moore
  2011-02-10  6:28             ` Reinhard Meyer
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Moore @ 2011-02-10  6:22 UTC (permalink / raw)
  To: u-boot

Hi,

Me again.

Le 10/02/2011 07:16, Chris Moore a ?crit :
> Hi,
>
> Le 09/02/2011 22:17, Scott Wood a ?crit :
>> On Wed, 9 Feb 2011 07:40:44 +0100
>> Albert ARIBAUD<albert.aribaud@free.fr>   wrote:
>>
>>> Le 09/02/2011 07:19, Chris Moore a ?crit :
>>>> I also noticed this in some of my (rare) posts.
>>>> I am using TB 3.1.5.
>>>> I am too ashamed to admit my OS ;-)
>>>>
>>>> A nonsense test case written with correct spacing: a = (b>   (c>>   1))&&
>>>> ((d<   ((e&   1)<<   1)));
>>>> If you receive this correctly then please excuse me for the noise :(
>>> Received correctly. :)
>>>
>>> In Rob's case I am not sure that the issue is due to TB eating selected
>>> spaces upon reception; my own TB (3.1.7), using ^U to display the raw
>>> message from Rob, shows missing spaces are actually in what was sent,
>>> and I think Wolfgang does not use TB at all.
>> It's when quoting a message for a reply that Thunderbird does this mangling.
>>
> Right, that would seem to be this bug:
> https://bugzilla.mozilla.org/show_bug.cgi?id=448198
> I have certainly encountered this one when quoting :(
>
> But there is also: https://bugzilla.mozilla.org/show_bug.cgi?id=597181
> I wonder if I haven't run into this one too :(

Note that my reply introduced the quoted text bug in my test case above :(

Cheers,
Chris

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] Thunderbird bug (was PATCH-add "0X" hexadecimal prefix to simple_strtoul)
  2011-02-10  6:22           ` Chris Moore
@ 2011-02-10  6:28             ` Reinhard Meyer
  0 siblings, 0 replies; 8+ messages in thread
From: Reinhard Meyer @ 2011-02-10  6:28 UTC (permalink / raw)
  To: u-boot

Dear Chris Moore,
> Hi,
>
> Me again.
>
> Le 10/02/2011 07:16, Chris Moore a ?crit :
>> Hi,
>>
>> Le 09/02/2011 22:17, Scott Wood a ?crit :
>>> On Wed, 9 Feb 2011 07:40:44 +0100
>>> Albert ARIBAUD<albert.aribaud@free.fr>    wrote:
>>>
>>>> Le 09/02/2011 07:19, Chris Moore a ?crit :
>>>>> I also noticed this in some of my (rare) posts.
>>>>> I am using TB 3.1.5.
>>>>> I am too ashamed to admit my OS ;-)
>>>>>
>>>>> A nonsense test case written with correct spacing: a = (b>    (c>>    1))&&
>>>>> ((d<    ((e&    1)<<    1)));
>>>>> If you receive this correctly then please excuse me for the noise :(
>>>> Received correctly. :)
>>>>
>>>> In Rob's case I am not sure that the issue is due to TB eating selected
>>>> spaces upon reception; my own TB (3.1.7), using ^U to display the raw
>>>> message from Rob, shows missing spaces are actually in what was sent,
>>>> and I think Wolfgang does not use TB at all.
>>> It's when quoting a message for a reply that Thunderbird does this mangling.
>>>
>> Right, that would seem to be this bug:
>> https://bugzilla.mozilla.org/show_bug.cgi?id=448198
>> I have certainly encountered this one when quoting :(
>>
>> But there is also: https://bugzilla.mozilla.org/show_bug.cgi?id=597181
>> I wonder if I haven't run into this one too :(
>
> Note that my reply introduced the quoted text bug in my test case above :(

The space mangling even happens when one saves an e-mail (e.g. a patch).
I am glad we now have patchwork to download patches... Before I used an old
(theoretical insecure) thunderbird version to do that.

Best Regards,
Reinhard

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-02-10  6:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-08 16:38 [U-Boot] PATCH-add "0X" hexadecimal prefix to simple_strtoul Rob Alexander
2011-02-08 19:14 ` Wolfgang Denk
2011-02-09  6:19   ` Chris Moore
2011-02-09  6:40     ` Albert ARIBAUD
2011-02-09 21:17       ` Scott Wood
2011-02-10  6:16         ` [U-Boot] Thunderbird bug (was PATCH-add "0X" hexadecimal prefix to simple_strtoul) Chris Moore
2011-02-10  6:22           ` Chris Moore
2011-02-10  6:28             ` Reinhard Meyer

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.