[asterisk-commits] rizzo: trunk r48512 - /trunk/res/res_limit.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Dec 15 19:42:54 MST 2006


Author: rizzo
Date: Fri Dec 15 20:42:53 2006
New Revision: 48512

URL: http://svn.digium.com/view/asterisk?view=rev&rev=48512
Log:
prevent a compiler warning


Modified:
    trunk/res/res_limit.c

Modified: trunk/res/res_limit.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_limit.c?view=diff&rev=48512&r1=48511&r2=48512
==============================================================================
--- trunk/res/res_limit.c (original)
+++ trunk/res/res_limit.c Fri Dec 15 20:42:53 2006
@@ -90,13 +90,14 @@
 		}
 
 		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 {



More information about the asterisk-commits mailing list