From 87a9493b2353f1ba7a0ea1bac3d8b7dbe3172d27 Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Wed, 28 Jan 2009 02:32:02 +0100 Subject: [PATCH] URLs: Fixed some broken comparisons of possibly signed chars. (It was causing failures in Shepherd.) --- ucw/url.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ucw/url.c b/ucw/url.c index 4b0ddeaa..39e52946 100644 --- a/ucw/url.c +++ b/ucw/url.c @@ -150,7 +150,7 @@ url_enescape(const char *s, char *d) *d++ = *s++; else { - uns val = ((byte)*s < NCC_MAX) ? NCC_CHARS[(byte)*s] : *s; + uns val = (byte)(((byte)*s < NCC_MAX) ? NCC_CHARS[(byte)*s] : *s); *d++ = '%'; *d++ = enhex(val >> 4); *d++ = enhex(val & 0x0f); @@ -170,14 +170,14 @@ url_enescape_friendly(const char *src, char *dest) { if (dest >= end) return URL_ERR_TOO_LONG; - if (*srcb < NCC_MAX) + if ((byte)*srcb < NCC_MAX) *dest++ = NCC_CHARS[*srcb++]; else if (*srcb >= 0x20 && *srcb < 0x7f) *dest++ = *srcb++; else { *dest++ = '%'; - *dest++ = enhex(*srcb >> 4); + *dest++ = enhex((byte)*srcb >> 4); *dest++ = enhex(*srcb++ & 0x0f); } } -- 2.39.5