Fix 32 bits overflow with -M option

$ zzuf -M 4096 -s 0:1 /bin/cat
/bin/cat: Argument list too long
This commit is contained in:
Rafaël Carré 2016-06-03 00:19:39 +02:00
parent 14138cd218
commit a37e3d8af4

View File

@ -262,8 +262,8 @@ static int run_process(zzuf_child_t *child, zzuf_opts_t *opts, int pipes[][2])
if (opts->maxmem >= 0)
{
struct rlimit rlim;
rlim.rlim_cur = opts->maxmem * 1048576;
rlim.rlim_max = opts->maxmem * 1048576;
rlim.rlim_cur = (uint64_t)opts->maxmem * 1048576;
rlim.rlim_max = (uint64_t)opts->maxmem * 1048576;
setrlimit(ZZUF_RLIMIT_MEM, &rlim);
}
#endif