Mercurial > hg > mlmmj
diff src/strgen.c @ 731: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 | a81c74ff2995 |
children | dd5b87ddd51e |
line wrap: on
line diff
--- a/src/strgen.c Sat Jul 31 00:25:36 2010 +1000 +++ b/src/strgen.c Sat Jul 31 00:26:30 2010 +1000 @@ -40,10 +40,10 @@ char *random_str() { - size_t len = 128; + size_t len = 17; char *dest = mymalloc(len); - snprintf(dest, len, "%x%x", random_int(), random_int()); + snprintf(dest, len, "%08x%08x", random_int(), random_int()); return dest; }