summaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 6f5df23..39ca927 100644
--- a/utils.c
+++ b/utils.c
@@ -3077,3 +3077,14 @@ unsigned int get_unit_mode_from_arg(int *argc, char *argv[], int df_mode)
return unit_mode;
}
+
+int string_is_numerical(const char *str)
+{
+ if (!(*str >= '0' && *str <= '9'))
+ return 0;
+ while (*str >= '0' && *str <= '9')
+ str++;
+ if (*str != '\0')
+ return 0;
+ return 1;
+}