Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] Fix bug in parse_color that prevented the user from changing the background colors.

From: Chris Larson <hidden>
Date: 2016-06-15 22:44:10

On Feb 5, 2008 11:39 AM, Timo Hirvonen [off-list ref] wrote:
Chris Larson [off-list ref] wrote:
quoted
unable to convert the string in its entirety into an integer.
quoted
-    if (*name && !*end && i >= -1 && i <= 255)
+    if (*name && i >= -1 && i <= 255)
         return i;
     return -2;
 }

My bug, sorry. I should have tested more.

I think this new code accepts "7bold" (didn't test).  Maybe you should
do something like this instead:

       if (*name && (!*end || isspace(*end)) && i >= -1 && i <= 255)
Indeed, I should have tested more too :)  Just starting to mess with
the codebase, surprised at how clean it is (though I probably
shouldn't be).
Untested of course.  BTW, your patch is whitespace corrupted.
Unsurprising... sometimes I really hate gmail :|  Anyone know if
there's a way to post with gmail without hosing the patch, or should I
switch to a non-web based solution?

Thanks,
-- 
Chris Larson - clarson at kergoth dot com
Dedicated Engineer - MontaVista - clarson at mvista dot com
Core Developer/Architect - TSLib, BitBake, OpenEmbedded, OpenZaurus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help