---
shuf.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/shuf.c b/shuf.c
index 36b3898..21210de 100644
--- a/shuf.c
+++ b/shuf.c
@@ -47,11 +47,11 @@ main(int argc, char *argv[])
}
}
- random_seed();
+ rng32_seed();
if (!rflag) {
for (i = buf.nlines - 1; i > 0; i--) {
- j = random_uniform(i+1);
+ j = rng32_bounded(i+1);
line = buf.lines[j];
buf.lines[j] = buf.lines[i];
buf.lines[i] = line;
@@ -63,7 +63,7 @@ main(int argc, char *argv[])
}
} else {
for (;;) {
- j = random_uniform(buf.nlines);
+ j = rng32_bounded(buf.nlines);
line = buf.lines[j];
fwrite(line.data, 1, line.len, stdout);
}
--
2.44.0- [hackers] [sbase][PATCH] Add implementation o... Elie Le Vaillant
- [hackers] [sbase][PATCH] libutil: add ra... Elie Le Vaillant
- [hackers] [sbase][PATCH] shuf: use l... Elie Le Vaillant
- [hackers] [sbase][PATCH] libutil/ran... Elie Le Vaillant
- [hackers] [sbase][PATCH] shuf: u... Elie Le Vaillant
- [hackers] [sbase][PATCH] cron: u... Elie Le Vaillant
- [hackers] [sbase][PATCH] lib... Elie Le Vaillant
- [hackers] [sbase][PATCH... Elie Le Vaillant
- [hackers] [sbase][P... Elie Le Vaillant
- Re: [hackers] [sbase][P... Steve Ward
- Re: [hackers] [sbase][P... NRK
- [hackers] [sbase][PATCH] cro... Elie Le Vaillant
- Re: [hackers] [sbase][P... Roberto E . Vargas Caballero
- Re: [hackers] [sbas... Elie Le Vaillant
- Re: [hackers] [... Roberto E . Vargas Caballero
