Skip to content

Commit

Permalink
修复最大内存限制数字可能溢出的问题
Browse files Browse the repository at this point in the history
将int改为了long
  • Loading branch information
virusdefender committed Mar 22, 2016
1 parent 62f6e7a commit 5304fe4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion judger.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ static PyObject *judger_run(PyObject *self, PyObject *args, PyObject *kwargs) {
"max_memory", "args", "env", "use_sandbox", "use_nobody", NULL};

config.path = config.in_file = config.out_file = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "sssii|OOOO", kwargs_list, &(config.path), &(config.in_file),
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "sssil|OOOO", kwargs_list, &(config.path), &(config.in_file),
&(config.out_file), &(config.max_cpu_time), &(config.max_memory),
&args_list, &env_list, &use_sandbox, &use_nobody)) {
PyErr_SetString(PyExc_ValueError, "Invalid args and kwargs");
Expand Down
2 changes: 1 addition & 1 deletion runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ struct result {

struct config {
int max_cpu_time;
int max_memory;
long max_memory;
char *path;
char *in_file;
char *out_file;
Expand Down

0 comments on commit 5304fe4

Please sign in to comment.