diff options
| author | Markus Uhlin <markus@nifty-networks.net> | 2025-11-19 20:30:23 +0100 |
|---|---|---|
| committer | Markus Uhlin <markus@nifty-networks.net> | 2025-11-19 20:30:23 +0100 |
| commit | aeac3de6549f57ca2af215c217749aa9b2adc95f (patch) | |
| tree | d180a61da3a2002e97bd3db62a6d3aeea6b408e9 /FICS/settings.cpp | |
| parent | a80e33d2dae5ed84da5739d99dc30a0b51e5d085 (diff) | |
Added is_numeric()
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[] = |
