chiark / gitweb /
Columns are now resizable and wide columns are ellipsized. Columns
[disorder] / lib / random.c
index 21d0b09a93a63662dc5177b95f2fa7511544b13e..ce87abd00c3aa73e9ac876f2ad88a0e489fcc667 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);
 }