summaryrefslogtreecommitdiff
path: root/lib/frrstr.c
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2018-06-20 07:38:19 -0400
committerGitHub <noreply@github.com>2018-06-20 07:38:19 -0400
commit96be948bcda2150d0097a38e9e9786fa043692fd (patch)
treea7ddf06b0a636b5c06225070b69d6161fa776afa /lib/frrstr.c
parentedc5b3e52e39252a7a996ca8be685bb371669289 (diff)
parent5d5ba0185dd63e5443a9c005f8b369b17e82ab03 (diff)
Merge pull request #2495 from pacovn/fixme_all_digit
bgpd, lib, ospfd, zebra: all_digit moved to frrstr
Diffstat (limited to 'lib/frrstr.c')
-rw-r--r--lib/frrstr.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/frrstr.c b/lib/frrstr.c
index 82c0ad7730..715e67b868 100644
--- a/lib/frrstr.c
+++ b/lib/frrstr.c
@@ -161,3 +161,11 @@ bool begins_with(const char *str, const char *prefix)
return strncmp(str, prefix, lenprefix) == 0;
}
+
+int all_digit(const char *str)
+{
+ for (; *str != '\0'; str++)
+ if (!isdigit((int)*str))
+ return 0;
+ return 1;
+}