mlmmj

changeset dd5b87ddd51e

Make *all* random strings produced the same length
author Ben Schmidt
date Wed, 20 Oct 2010 12:34:28 +1100
parents c7d0a386aef5
children e08598db1be1
files src/strgen.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/src/strgen.c	Wed Oct 20 11:39:58 2010 +1100
     1.2 +++ b/src/strgen.c	Wed Oct 20 12:34:28 2010 +1100
     1.3 @@ -62,7 +62,7 @@
     1.4  	MY_ASSERT(atsign);
     1.5  	*atsign = '=';
     1.6  
     1.7 -	snprintf(dest, len, "%x%x-%s", random_int(), random_int(), tmpstr);
     1.8 +	snprintf(dest, len, "%08x%08x-%s", random_int(), random_int(), tmpstr);
     1.9  
    1.10  	myfree(tmpstr);
    1.11  	
    1.12 @@ -268,7 +268,7 @@
    1.13  {
    1.14  	char buf[256];
    1.15  
    1.16 -	snprintf(buf, sizeof(buf), "Message-ID: <%ld-%d-mlmmj-%x@%s>\n",
    1.17 +	snprintf(buf, sizeof(buf), "Message-ID: <%ld-%d-mlmmj-%08x@%s>\n",
    1.18  			(long int)time(NULL), (int)getpid(), random_int(), fqdn);
    1.19  
    1.20  	return mystrdup(buf);