]>
git.ipfire.org Git - thirdparty/git.git/blob - t/helper/test-genzeros.c
2 #include "git-compat-util.h"
4 int cmd__genzeros(int argc
, const char **argv
)
6 /* static, so that it is NUL-initialized */
7 static const char zeros
[256 * 1024];
12 fprintf(stderr
, "usage: %s [<count>]\n", argv
[0]);
16 count
= argc
> 1 ? strtoimax(argv
[1], NULL
, 0) : -1;
18 /* Writing out individual NUL bytes is slow... */
20 if (xwrite(1, zeros
, ARRAY_SIZE(zeros
)) < 0)
21 die_errno("write error");
25 count
< ARRAY_SIZE(zeros
)
26 ? count
: ARRAY_SIZE(zeros
));
29 die_errno("write error");