On Mon, Feb 23, 2026 at 06:13:46AM -0500, Jeff King wrote:
Show 12 quoted lines
> On Mon, Feb 23, 2026 at 10:50:40AM +0100, Patrick Steinhardt wrote:
> > @@ -22,7 +23,9 @@ int cmd__genrandom(int argc, const char **argv)
> > next = next * 11 + *c;
> > } while (*c++);
> >
> > - count = (argc == 3) ? strtoul(argv[2], NULL, 0) : ULONG_MAX;
> > + count = ULONG_MAX;
> > + if (argc == 3 && git_parse_ulong(argv[2], &count) < 0)
> > + return error_errno("cannot parse argument '%s'", argv[2]);
>
> ...I think the return value of git_parse_ulong() is boolean 0/1, not
> 0/negative.