aboutsummaryrefslogtreecommitdiffstats
path: root/doc/CODING-GUIDELINES
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-13 18:38:55 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-13 18:38:55 +0000
commitc68a2d2d8eeae4700c5d8aca778baebd63261010 (patch)
tree5a94467aed03520611a253029bd57ee366f338e5 /doc/CODING-GUIDELINES
parentf94feca2c56f917573ddbfe2138f3cc6bb6e30fa (diff)
Various cleanups from comments in an email from Luigi Rizzo. Thank you!
- Use a cleaner syntax for declaring the allocation macros - Fix return value for ast_strdup/ast_strndup - remove safe_strdup from app_macro, since ast_strup does the same thing - fix a place in app_queue where ast_calloc+strncpy was used instead of ast_strdup. If you are helping out with these conversions, please watch out for other places where this is done. - add a note to the coding guidelines about the fix to app_queue git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8065 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'doc/CODING-GUIDELINES')
-rw-r--r--doc/CODING-GUIDELINES4
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/CODING-GUIDELINES b/doc/CODING-GUIDELINES
index 7e4679be7..e64bbd345 100644
--- a/doc/CODING-GUIDELINES
+++ b/doc/CODING-GUIDELINES
@@ -386,6 +386,10 @@ argument without generating an error. The same code can be written as:
newstr = ast_strdup(str);
+Furthermore, it is unnecessary to have code that malloc/calloc's for the length
+of a string (+1 for the terminating '\0') and then using strncpy to copy the
+copy the string into the resulting buffer. This is the exact same thing as
+using ast_strdup.
* CLI Commands
--------------