Skip to content

Commit

Permalink
Use correct printf format specifier for filesize. (#2158)
Browse files Browse the repository at this point in the history
The default value for filesize for scripts is 2.5GB, so more than 2^31
bytes, previously this caused a message like

```
/home/sitowert/domjudge/bin/runguard [56839 @   0.001495]: verbose: setting filesize limit to -1610612736 bytes
```

After this commit, it is:
```
/home/sitowert/domjudge/bin/runguard [56839 @   0.001521]: verbose: setting filesize limit to 2684354560 bytes
```

(cherry picked from commit a12c260)
  • Loading branch information
meisterT authored and vmcj committed Feb 28, 2024
1 parent 25d5276 commit ac19b7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion judge/runguard.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ void setrestrictions()
setlim(STACK);

if ( filesize!=RLIM_INFINITY ) {
verbose("setting filesize limit to %d bytes",(int)filesize);
verbose("setting filesize limit to %lu bytes",filesize);
lim.rlim_cur = lim.rlim_max = filesize;
setlim(FSIZE);
}
Expand Down

0 comments on commit ac19b7d

Please sign in to comment.