[Asterisk-cvs] asterisk/doc CODING-GUIDELINES,1.7,1.8

kpfleming at lists.digium.com kpfleming at lists.digium.com
Sat Apr 23 10:21:15 CDT 2005


Update of /usr/cvsroot/asterisk/doc
In directory mongoose.digium.com:/tmp/cvs-serv23133/doc

Modified Files:
	CODING-GUIDELINES 
Log Message:
add guideline comment about not using '%i' with scanf


Index: CODING-GUIDELINES
===================================================================
RCS file: /usr/cvsroot/asterisk/doc/CODING-GUIDELINES,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- CODING-GUIDELINES	1 Apr 2005 04:38:12 -0000	1.7
+++ CODING-GUIDELINES	23 Apr 2005 15:11:28 -0000	1.8
@@ -24,6 +24,10 @@
 Functions and variables that are not intended to be global must be
 declared static.
 
+When reading integer numeric input with scanf (or variants), do _NOT_ use '%i'
+unless specifically want to allow non-base-10 input; '%d' is always a better
+choice, since it will not silently turn numbers with leading zeros into base-8.
+
 Roughly, Asterisk coding guidelines are generally equivalent to the 
 following:
 




More information about the svn-commits mailing list