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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@341533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Terry Wilson 2011-10-20 15:17:53 +00:00
parent 3f98c937a1
commit 2f1130e13f
1 changed files with 4 additions and 4 deletions

View File

@ -878,13 +878,13 @@ int __attribute__((format(printf, 3, 4))) ast_str_append(
* \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;
}