diff --git a/src/common/header/shared.h b/src/common/header/shared.h index 35939b90..492986c1 100644 --- a/src/common/header/shared.h +++ b/src/common/header/shared.h @@ -335,6 +335,7 @@ void Q_strdel(char *s, size_t i, size_t n); /* Insert src into dest starting at index i, total, n is the total size of the buffer */ /* Returns length of src on success, 0 if there is not enough space in dest for src */ size_t Q_strins(char *dest, const char *src, size_t i, size_t n); +qboolean Q_strisnum(const char *s); /* ============================================= */ diff --git a/src/common/shared/shared.c b/src/common/shared/shared.c index 792ffde8..e7521725 100644 --- a/src/common/shared/shared.c +++ b/src/common/shared/shared.c @@ -1190,6 +1190,20 @@ Q_strins(char *dest, const char *src, size_t i, size_t n) return slen; } +qboolean +Q_strisnum(const char *s) +{ + for (; *s != '\0'; s++) + { + if (!isdigit(*s)) + { + return false; + } + } + + return true; +} + /* * An unicode compatible fopen() Wrapper for Windows. */