Re: structure toupper\lower?
Keith Thompson wrote:
[color=blue]
> char c = some_value;
> c = toupper(c);[/color]
That can crash if 'char' is signed c becomes negative (i.e. for
non-ASCII characters if you have 8-bit bytes and an ASCII superset).
It should be
c = toupper((unsign ed char) c);
--
Hallvard
Keith Thompson wrote:
[color=blue]
> char c = some_value;
> c = toupper(c);[/color]
That can crash if 'char' is signed c becomes negative (i.e. for
non-ASCII characters if you have 8-bit bytes and an ASCII superset).
It should be
c = toupper((unsign ed char) c);
--
Hallvard
Comment