From: David Levine Date: Sun, 22 Jul 2012 01:00:14 +0000 (-0500) Subject: Tidied up for loop in message_id(). X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=015e83362f21a061bf268b878693d72309c21e55;p=mmh Tidied up for loop in message_id(). --- diff --git a/sbr/message_id.c b/sbr/message_id.c index adf45cd..d1efd9d 100644 --- a/sbr/message_id.c +++ b/sbr/message_id.c @@ -75,16 +75,18 @@ message_id (time_t tclock, int content_id) { } { - char *cp = (char *) rnd_base64; + char *cp; /* Try to make the base64 string look a little more like a hostname by replacing + with - and / with _. Also, the format string inserts a couple of dots. */ - for ( ; *cp; ++cp) { + for (cp = (char *) rnd_base64; *cp; ++cp) { char *plus, *slash; if ((plus = strchr (cp, '+'))) { *plus = '-'; } else if ((slash = strchr (cp, '/'))) { *slash = '_'; + } else { + break; } } }