[asterisk-commits] mjordan: trunk r376457 - /trunk/tests/test_astobj2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Nov 18 20:14:58 CST 2012


Author: mjordan
Date: Sun Nov 18 20:14:54 2012
New Revision: 376457

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=376457
Log:
Fix uninitialized in this function error

With some versions of gcc, n_buckets will be flagged as being uninitialized
before use.  While its technically impossible (since the switch statement,
even without a default, accounts for all possibilities), we'll initialize the
variable to 0 anyway.

Modified:
    trunk/tests/test_astobj2.c

Modified: trunk/tests/test_astobj2.c
URL: http://svnview.digium.com/svn/asterisk/trunk/tests/test_astobj2.c?view=diff&rev=376457&r1=376456&r2=376457
==============================================================================
--- trunk/tests/test_astobj2.c (original)
+++ trunk/tests/test_astobj2.c Sun Nov 18 20:14:54 2012
@@ -424,7 +424,7 @@
 	struct ao2_iterator *mult_it;
 	struct test_obj *obj;
 	ao2_callback_fn *cmp_fn;
-	int n_buckets;
+	int n_buckets = 0;
 	int increment = 0;
 	int destructor_count = 0;
 	int count;




More information about the asterisk-commits mailing list