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
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@341530
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
* \retval 0 The string contains non-digit characters
*/
AST_INLINE_API(
-int ast_check_digits(char *arg),
+int ast_check_digits(const char *arg),
{
- char *s;
- for (s=arg; *s; s++) {
- if (*s < '0' || *s > '9') {
+ while (*arg) {
+ if (*arg < '0' || *arg > '9') {
return 0;
}
+ arg++;
}
return 1;
}