Skip to content

Commit cbc985a

Browse files
carenasgitster
authored andcommitted
test-genzeros: allow more than 2G zeros in Windows
d5cfd14 (tests: teach the test-tool to generate NUL bytes and use it, 2019-02-14), add a way to generate zeroes in a portable way without using /dev/zero (needed by HP NonStop), but uses a long variable that is limited to 2^31 in Windows. Use instead a (POSIX/C99) intmax_t that is at least 64bit wide in 64-bit Windows to use in a future test. Signed-off-by: Carlo Marcelo Arenas Belón <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ebf3c04 commit cbc985a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

t/helper/test-genzeros.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
int cmd__genzeros(int argc, const char **argv)
55
{
6-
long count;
6+
intmax_t count;
77

88
if (argc > 2) {
99
fprintf(stderr, "usage: %s [<count>]\n", argv[0]);
1010
return 1;
1111
}
1212

13-
count = argc > 1 ? strtol(argv[1], NULL, 0) : -1L;
13+
count = argc > 1 ? strtoimax(argv[1], NULL, 0) : -1;
1414

1515
while (count < 0 || count--) {
1616
if (putchar(0) == EOF)

0 commit comments

Comments
 (0)