aboutsummaryrefslogtreecommitdiffstats
path: root/doc/CODING-GUIDELINES
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-23 15:11:28 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-04-23 15:11:28 +0000
commitbefaca8efdb7552270fb5204cda24e71577815ae (patch)
tree58271a4ca57826f59f61996c933d7d24013c2e4d /doc/CODING-GUIDELINES
parentc93c33a99ac7281560c1fbe441a3055854689338 (diff)
add guideline comment about not using '%i' with scanf
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5501 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'doc/CODING-GUIDELINES')
-rwxr-xr-xdoc/CODING-GUIDELINES4
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/CODING-GUIDELINES b/doc/CODING-GUIDELINES
index f115094d0..b9fcfba1e 100755
--- a/doc/CODING-GUIDELINES
+++ b/doc/CODING-GUIDELINES
@@ -24,6 +24,10 @@ Try to match the existing formatting of the file you are working on.
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: