summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2023-04-12 14:56:05 +0200
committerDenys Vlasenko2023-04-12 14:56:05 +0200
commitf7065aa9ae54ce0d1772fd2e6f0e0b6862a50b71 (patch)
treeb13faccd941622e2c8ee561d18f00806ae53888d
parent8696f5d380209e6aba13ffc52eced9239510b275 (diff)
downloadbusybox-f7065aa9ae54ce0d1772fd2e6f0e0b6862a50b71.zip
busybox-f7065aa9ae54ce0d1772fd2e6f0e0b6862a50b71.tar.gz
shuf: fix pfx_len calculation
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--coreutils/shuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/coreutils/shuf.c b/coreutils/shuf.c
index 3483a28..107899a 100644
--- a/coreutils/shuf.c
+++ b/coreutils/shuf.c
@@ -138,7 +138,7 @@ int shuf_main(int argc, char **argv)
a--;
b--;
}
- pfx_len = a - opt_i_str; /* can end up being 0 */
+ pfx_len = a - pfx; /* can end up being 0 */
padding_width -= pfx_len;
} else {
/* Undo leading zero 'eating' (think "0-9") */