summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTerry Wilson <twilson@digium.com>2011-10-20 15:17:53 +0000
committerTerry Wilson <twilson@digium.com>2011-10-20 15:17:53 +0000
commit2f1130e13f48765b4fc8080bf2e1018a0a989344 (patch)
tree501400f39061cfd650c69a2323eefdec11ce4376 /include
parent3f98c937a16b4ae4793b49a68b9ddb0c621f1827 (diff)
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
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/strings.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index cd69c6b6b..2a8b0e490 100644
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -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;
}