[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/4] strtosz(): use unsigned char and switch to
From: |
Jes Sorensen |
Subject: |
Re: [Qemu-devel] [PATCH 1/4] strtosz(): use unsigned char and switch to qemu_isspace() |
Date: |
Mon, 24 Jan 2011 17:11:22 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.7 |
On 01/24/11 17:10, Markus Armbruster wrote:
> address@hidden writes:
>
>> From: Jes Sorensen <address@hidden>
>>
>> isspace() behavior is undefined for signed char.
>>
>> Bug pointed out by Eric Blake, thanks!
>>
>> Signed-off-by: Jes Sorensen <address@hidden>
>> ---
>> cutils.c | 7 ++++---
>> 1 files changed, 4 insertions(+), 3 deletions(-)
>>
>> diff --git a/cutils.c b/cutils.c
>> index 4d2e27c..a067cf4 100644
>> --- a/cutils.c
>> +++ b/cutils.c
>> @@ -294,7 +294,8 @@ int fcntl_setfl(int fd, int flag)
>> int64_t strtosz_suffix(const char *nptr, char **end, const char
>> default_suffix)
>> {
>> int64_t retval = -1;
>> - char *endptr, c, d;
>> + char *endptr;
>> + unsigned char c, d;
>> int mul_required = 0;
>> double val, mul, integral, fraction;
>>
>
> I doubt this hunk is still needed.
It isn't strictly due to qemu_toupper() but it is prettier to match the
real behavior of pure toupper() anyway.
Jes
- [Qemu-devel] [PATCH v4 0/4] strtosz() cleanups, Jes . Sorensen, 2011/01/24
- [Qemu-devel] [PATCH 2/4] strtosz() use qemu_toupper() to simplify switch statement, Jes . Sorensen, 2011/01/24
- [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Jes . Sorensen, 2011/01/24
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Markus Armbruster, 2011/01/24
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Jes Sorensen, 2011/01/24
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Markus Armbruster, 2011/01/24
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Jes Sorensen, 2011/01/24
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Markus Armbruster, 2011/01/24
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Jes Sorensen, 2011/01/25
- Re: [Qemu-devel] [PATCH 4/4] strtosz(): Use suffix macros in switch() statement, Markus Armbruster, 2011/01/25