Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/common/lib/libc/string



On Tue, 08 Jan 2008, Martin Husemann wrote:
> Modified Files:
>       src/common/lib/libc/string: memchr.c strchr.c strrchr.c
> 
> Log Message:
> When passing char (or unsigned char) arguments as int, assign them to a
> temporary char (resp. unsigned char) before comparing, to force truncation
> to the proper domain. This makes the coresponding regression tests succeed.

Wouldn't casts have had the same effect?  e.g.:

        if (*p == (unsigned char)c) ...

--apb (Alan Barrett)



Home | Main Index | Thread Index | Old Index