mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-21 20:21:09 +00:00
Q_strisnum shared helper function
This commit is contained in:
parent
aae0524687
commit
8d5d86cbaf
2 changed files with 15 additions and 0 deletions
|
@ -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);
|
||||
|
||||
/* ============================================= */
|
||||
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue