This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] gethex doesn't cope with multibyte decimalpoints
On Feb 6 14:44, Howland Craig D (Craig) wrote:
> >> So perhaps should it be the following instead?
> >> + while (s0 < s1) {
> >> + if (!strncmp ((char *) s0, (char *) decimalpoint,
> dplen)) {
> >> + s0++;
> >> (That is, step through 1 byte at a time instead of by dlen at a
> time?)
> >
> >That's incorrect. If decimalpoint is some multibyte char you will hit
> >the next followup byte of the MB char in the next iteration. It will
> be
> >incorrectly converted to a hex digit. If you recognize a certain MB
> >char, you must skip it entirely.
> Duh on me. I guess I should have drawn the shades in my office to
> reduce
> the glare on the screen (which I just did, by the way): I was missing
> the ! in the if. (I should have known better than to doubt you ;)
No worries. I'm glad you took the time to review the patch.
Corinna
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat