[svn-commits] twilson: trunk r341533 - in /trunk: ./ include/asterisk/strings.h

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Oct 20 10:17:59 CDT 2011


Author: twilson
Date: Thu Oct 20 10:17:53 2011
New Revision: 341533

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=341533
Log:
Clean up ast_check_digits

The code was originally copied from the is_int() function in the AEL
code. wdoekes pointed out that the function should take a const char*
and that their was an unneeded variable. This is now fixed.
........

Merged revisions 341529 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 341530 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/include/asterisk/strings.h

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/include/asterisk/strings.h
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/strings.h?view=diff&rev=341533&r1=341532&r2=341533
==============================================================================
--- trunk/include/asterisk/strings.h (original)
+++ trunk/include/asterisk/strings.h Thu Oct 20 10:17:53 2011
@@ -878,13 +878,13 @@
  * \retval 0 The string contains non-digit characters
  */
 AST_INLINE_API(
-int ast_check_digits(char *arg),
-{
-	char *s;
-	for (s=arg; *s; s++) {
-		if (*s < '0' || *s > '9') {
+int ast_check_digits(const char *arg),
+{
+	while (*arg) {
+		if (*arg < '0' || *arg > '9') {
 			return 0;
 		}
+		arg++;
 	}
 	return 1;
 }




More information about the svn-commits mailing list