Fix strtol in Turkish locales (bug 19242)

Florian Weimer fweimer@redhat.com
Thu Nov 19 20:20:00 GMT 2015


On 11/13/2015 11:06 PM, Joseph Myers wrote:

> This patch makes the code check for the relevant ranges of letters
> rather than using toupper / isalpha (via macros) at all; locales
> remain used for whitespace testing (explicitly correct according to
> ISO C).  Note that the way the code worked, the only non-ASCII letter
> that would previously have been accepted would have been the Turkish
> 'ı' (dotless 'I'), because the uppercase version of that in Turkish
> locales is 'I'.  This patch means that will no longer be accepted,
> which seems appropriate.

Have you tested the performance impact of this change?  The locale-based
approach uses a lookup table, and it's not clear if the fairly involved
condition in the macro makes a difference.  (This code is probably quite
performance-sensitive for some applications.)

Should sscanf have a test as well?

Thanks,
Florian



More information about the Libc-alpha mailing list