t / helper / test-genzeros.con commit Merge branch 'sg/overlong-progress-fix' (425e51e)
   1#include "test-tool.h"
   2#include "git-compat-util.h"
   3
   4int cmd__genzeros(int argc, const char **argv)
   5{
   6        long count;
   7
   8        if (argc > 2) {
   9                fprintf(stderr, "usage: %s [<count>]\n", argv[0]);
  10                return 1;
  11        }
  12
  13        count = argc > 1 ? strtol(argv[1], NULL, 0) : -1L;
  14
  15        while (count < 0 || count--) {
  16                if (putchar(0) == EOF)
  17                        return -1;
  18        }
  19
  20        return 0;
  21}