summaryrefslogtreecommitdiffstats
path: root/dice.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-04-06 03:20:43 +0200
committerMattias Andrée <maandree@kth.se>2021-04-06 03:20:43 +0200
commit3fbe6edb3f2250fcf494e70105039a4f32c52066 (patch)
tree544ccc9d74fcf15ec9fb23bb27818b355f7b6f86 /dice.c
parentm + Add timer (diff)
downloadpdatools-3fbe6edb3f2250fcf494e70105039a4f32c52066.tar.gz
pdatools-3fbe6edb3f2250fcf494e70105039a4f32c52066.tar.bz2
pdatools-3fbe6edb3f2250fcf494e70105039a4f32c52066.tar.xz
Use libsimple instead of libcore
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'dice.c')
-rw-r--r--dice.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/dice.c b/dice.c
index 69fc911..3403c59 100644
--- a/dice.c
+++ b/dice.c
@@ -1,6 +1,5 @@
/* See LICENSE file for copyright and license details. */
#include "common.h"
-#include <sys/random.h>
/* TODO add support for up and down arrows to browse previous entries in the same session */
@@ -74,7 +73,7 @@ parse_dice(const char *s, struct die **dicep, size_t *ndicep)
if (!isdigit(*s) && *s != '-' && *s != 'd' && *s != 'D')
goto invalid;
- dice = erealloc2(dice, ++ndice, sizeof(*dice));
+ dice = ereallocn(dice, ++ndice, sizeof(*dice), 0);
die = &dice[ndice - 1];
die->count = 1;
die->min = 1;