diff options
Diffstat (limited to 'FICS/settings.cpp')
| -rw-r--r-- | FICS/settings.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/FICS/settings.cpp b/FICS/settings.cpp index de25098..ad1cc02 100644 --- a/FICS/settings.cpp +++ b/FICS/settings.cpp @@ -113,6 +113,20 @@ check_some_settings_strictly(void) } bool +is_numeric(const char *string) +{ + if (string == nullptr || *string == '\0') + return false; + + for (const char *cp = &string[0]; *cp != '\0'; cp++) { + if (!isdigit(*cp)) + return false; + } + + return true; +} + +bool is_valid_hostname(const char *p_str, err_reason_t *p_reason) { const char legal_index[] = |
