diff options
author | Luigi Rizzo <rizzo@icir.org> | 2006-12-16 02:42:53 +0000 |
---|---|---|
committer | Luigi Rizzo <rizzo@icir.org> | 2006-12-16 02:42:53 +0000 |
commit | a61418e1df3dd8ebb582d3ed1bbf5447915b8482 (patch) | |
tree | 55705dd838c626e0396085012223574b789373c2 /res | |
parent | 055abfe9d96e884c12dc41884e9472f41c5b8591 (diff) |
prevent a compiler warning
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/res_limit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/res/res_limit.c b/res/res_limit.c index 217858d67..4db463d6e 100644 --- a/res/res_limit.c +++ b/res/res_limit.c @@ -90,13 +90,14 @@ static int my_ulimit(int fd, int argc, char **argv) } if (argc == 3) { + int x; if (resource != RLIMIT_NOFILE && resource != RLIMIT_CORE && resource != RLIMIT_NPROC && resource != RLIMIT_FSIZE) { ast_cli(fd, "Resource not permitted to be set\n"); return RESULT_FAILURE; } - sscanf(argv[2], "%d", (int *)&rlimit.rlim_cur); - rlimit.rlim_max = rlimit.rlim_cur; + sscanf(argv[2], "%d", &x); + rlimit.rlim_max = rlimit.rlim_cur = x; setrlimit(resource, &rlimit); return RESULT_SUCCESS; } else { |