From: Pierre Habouzit Date: Tue, 14 Nov 2006 22:47:22 +0000 (+0100) Subject: oopsie, small fixes. X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=commitdiff_plain;h=b241f87351127948f83842d537c1a76536bf61c1;hp=2c3617ad2d8a2ad98b573cc34483d1cb7cd451f5 oopsie, small fixes. Signed-off-by: Pierre Habouzit --- diff --git a/charset.c b/charset.c index 544b357..a1541f0 100644 --- a/charset.c +++ b/charset.c @@ -66,10 +66,9 @@ void mutt_canonical_charset(char *dest, ssize_t dlen, const char *name) // canonize name: only keep a-z0-9 and dots, put into lowercase for (i = 0; i < ssizeof(scratch); i++) { if (isalnum(*name) || *name == '.') { - scratch[i++] = tolower((unsigned char)*name); - } - - if (!*name || *name == ':') { + scratch[i] = tolower((unsigned char)*name); + } else + if (!*name || *name == ':' || i + 1 == ssizeof(scratch)) { scratch[i] = '\0'; break; }