prevent a compiler warning
authorLuigi Rizzo <rizzo@icir.org>
Sat, 16 Dec 2006 02:42:53 +0000 (02:42 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Sat, 16 Dec 2006 02:42:53 +0000 (02:42 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48512 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_limit.c

index 217858d..4db463d 100644 (file)
@@ -90,13 +90,14 @@ static int my_ulimit(int fd, int argc, char **argv)
                }
 
                if (argc == 3) {
                }
 
                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;
                        }
 
                        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 {
                        setrlimit(resource, &rlimit);
                        return RESULT_SUCCESS;
                } else {