X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/8139180649a758e0766757952e87b20e88fdd3ed..987fadb3bd0a40e55ba4e228dc0ef4269893a2ad:/sbr/message_id.c diff --git a/sbr/message_id.c b/sbr/message_id.c index adf45cdf..d1efd9d7 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; } } }