Source code reorganization:
[disorder] / lib / random.c
index 21d0b09..ce87abd 100644 (file)
  *
  */
 
-#include <config.h>
-#include "types.h"
+#include "common.h"
 
 #include <fcntl.h>
 #include <unistd.h>
 #include <errno.h>
-#include <string.h>
 
 #include "random.h"
 #include "log.h"
@@ -83,7 +81,7 @@ char *random_id(void) {
   char id[128];
 
   random_get(words, sizeof words);
-  basen(words, 4, id, sizeof id, 62);
+  basen(words, sizeof words / sizeof *words, id, sizeof id, 62);
   return xstrdup(id);
 }