From 2054ea5743fcb5750fe8cd7981e3348ec161473a Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 22 Nov 2006 21:41:54 +0000 Subject: [PATCH] ugly, but it does not warn git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@801 9efc2488-bf62-4759-914b-345cdb29e865 --- src/utils/utils.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/utils.c b/src/utils/utils.c index 58644a0..004e027 100644 --- a/src/utils/utils.c +++ b/src/utils/utils.c @@ -255,17 +255,17 @@ char* uescape( const char* string, int size, int full_escape ) { growing_buffer* buf = buffer_init(size + 64); int idx = 0; - long unsigned int c = 0; + int c = 0; while (string[idx]) { c ^= c; - if (!(string[idx] < 0x80)) { // not ASCII - if (string[idx]>= 0xc0 && string[idx] <= 0xfd) { // starts a UTF8 string + if (!((unsigned char)string[idx] < 0x80)) { // not ASCII + if ((unsigned char)string[idx] >= 0xc0 && (unsigned char)string[idx] <= 0xfd) { // starts a UTF8 string do { - c = (c << 6) | (string[idx] & 0x3f); // add this byte worth - } while ((string[idx + 1] >= 0x80 && string[idx + 1] <= 0xbf) && idx++); // and continue if there's more + c = (c << 6) | ((unsigned char)string[idx] & 0x3f); // add this byte worth + } while (((unsigned char)string[idx + 1] >= 0x80 && (unsigned char)string[idx + 1] <= 0xbf) && idx++); // and continue if there's more buffer_fadd(buf, "\\u%0.4x", c); } else return NULL; } else { -- 2.43.2