mlmmj

changeset e29893b9f581

Make the random strings produced always the same length rather the smaller random numbers producing shorter strings which could be problematic
author Ben Schmidt
date Sat, 31 Jul 2010 00:26:30 +1000
parents 793e5b2b28f2
children b37f66e0852b
files ChangeLog src/strgen.c
diffstat 2 files changed, 5 insertions(+), 2 deletions(-) [+]
line diff
     1.1 --- a/ChangeLog	Sat Jul 31 00:25:36 2010 +1000
     1.2 +++ b/ChangeLog	Sat Jul 31 00:26:30 2010 +1000
     1.3 @@ -1,3 +1,6 @@
     1.4 + o Makes the random strings produced always the same length rather the
     1.5 +   smaller random numbers producing shorter strings which could be
     1.6 +   problematic
     1.7   o Make random number generation more efficient by only seeding the
     1.8     generator once
     1.9   o Added feature to notify users when their posts are moderated
     2.1 --- a/src/strgen.c	Sat Jul 31 00:25:36 2010 +1000
     2.2 +++ b/src/strgen.c	Sat Jul 31 00:26:30 2010 +1000
     2.3 @@ -40,10 +40,10 @@
     2.4  
     2.5  char *random_str()
     2.6  {
     2.7 -	size_t len = 128;
     2.8 +	size_t len = 17;
     2.9  	char *dest = mymalloc(len);
    2.10  
    2.11 -	snprintf(dest, len, "%x%x", random_int(), random_int());
    2.12 +	snprintf(dest, len, "%08x%08x", random_int(), random_int());
    2.13  
    2.14  	return dest;
    2.15  }