[asterisk-bugs] [Asterisk 0010843]: [JANITOR] Change simple snprintf to ast_copy_string

noreply at bugs.digium.com noreply at bugs.digium.com
Sat Sep 29 08:07:42 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=10843 
====================================================================== 
Reported By:                Corydon76
Assigned To:                mvanbaak
====================================================================== 
Project:                    Asterisk
Issue ID:                   10843
Category:                   Core-General
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     assigned
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             09-28-2007 09:13 CDT
Last Modified:              09-29-2007 08:07 CDT
====================================================================== 
Summary:                    [JANITOR] Change simple snprintf to ast_copy_string
Description: 
There are a good number of places in the code that we needlessly call
snprintf(), when a plain string copy (ast_copy_string) will do.  Note that
a
simple rearrangement of the arguments is necessary, from:

snprintf(A, B, C);

to

ast_copy_string(A, C, B);

You can find most of the cases in the code with the following shell
command:

find . -name \*.c -exec grep -EHn 'snprintf\([^,]*,[^,]*,[^,]*\);' {} \;
====================================================================== 

---------------------------------------------------------------------- 
 mvanbaak - 09-29-07 08:07  
---------------------------------------------------------------------- 
All the lines found with that find line are done in the uploaded patch.
There are 5 left because ast_copy_string does not return anything 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
09-29-07 08:07  mvanbaak       Note Added: 0071206                          
======================================================================




More information about the asterisk-bugs mailing list