From cb7110e25e3b2615cd4189be538e089bc053762d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Sat, 12 Jul 2008 20:19:08 +0000 Subject: [PATCH] * some umlaut weirdness --- libcitadel/lib/stringbuf.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libcitadel/lib/stringbuf.c b/libcitadel/lib/stringbuf.c index 30c728f44..8e42b6333 100644 --- a/libcitadel/lib/stringbuf.c +++ b/libcitadel/lib/stringbuf.c @@ -382,7 +382,6 @@ void StrBufEUid_unescapize(StrBuf *target, StrBuf *source) { int a, b, len; char hex[3]; - int target_length = 0; if (target != NULL) FlushStrBuf(target); @@ -394,7 +393,7 @@ void StrBufEUid_unescapize(StrBuf *target, StrBuf *source) len = source->BufUsed; for (a = 0; a < len; ++a) { - if (target_length >= target->BufSize) + if (target->BufUsed >= target->BufSize) IncreaseBuf(target, 1, -1); if (source->buf[a] == '=') { @@ -403,13 +402,13 @@ void StrBufEUid_unescapize(StrBuf *target, StrBuf *source) hex[2] = 0; b = 0; sscanf(hex, "%02x", &b); - target->buf[target_length] = b; - target->buf[++target_length] = 0; + target->buf[target->BufUsed] = b; + target->buf[++target->BufUsed] = 0; a += 2; } else { - target->buf[target_length] = source->buf[a]; - target->buf[++target_length] = 0; + target->buf[target->BufUsed] = source->buf[a]; + target->buf[++target->BufUsed] = 0; } } } @@ -442,7 +441,7 @@ void StrBufEUid_escapize(StrBuf *target, StrBuf *source) else { sprintf(&target->buf[target->BufUsed], "=%02X", - source->buf[i]); + (0xFF &source->buf[i])); target->BufUsed += 3; } } -- 2.39.2