[asterisk-commits] twilson: branch 10 r341530 - in /branches/10: ./ include/asterisk/strings.h

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 20 10:14:11 CDT 2011


Author: twilson
Date: Thu Oct 20 10:14:08 2011
New Revision: 341530

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=341530
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

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

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

Modified: branches/10/include/asterisk/strings.h
URL: http://svnview.digium.com/svn/asterisk/branches/10/include/asterisk/strings.h?view=diff&rev=341530&r1=341529&r2=341530
==============================================================================
--- branches/10/include/asterisk/strings.h (original)
+++ branches/10/include/asterisk/strings.h Thu Oct 20 10:14:08 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 asterisk-commits mailing list