From 015e83362f21a061bf268b878693d72309c21e55 Mon Sep 17 00:00:00 2001 From: David Levine Date: Sat, 21 Jul 2012 20:00:14 -0500 Subject: [PATCH] Tidied up for loop in message_id(). --- sbr/message_id.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; } } } -- 1.7.10.4