diff options
author | Simon Howard | 2009-10-17 19:29:46 +0000 |
---|---|---|
committer | Simon Howard | 2009-10-17 19:29:46 +0000 |
commit | a3ab0a6910f55c6f45a3f4eaf48b4a99c4e16e22 (patch) | |
tree | 8c648b0f92bb6a9c9ce10420caa42e05207f4075 /src/m_misc.c | |
parent | df49602893b3bbe625dfc757949b93ea6b7339e0 (diff) | |
download | chocolate-doom-a3ab0a6910f55c6f45a3f4eaf48b4a99c4e16e22.tar.gz chocolate-doom-a3ab0a6910f55c6f45a3f4eaf48b4a99c4e16e22.tar.bz2 chocolate-doom-a3ab0a6910f55c6f45a3f4eaf48b4a99c4e16e22.zip |
Import donut overrun emulation code from PrBoom+ (Thanks entryway).
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1720
Diffstat (limited to 'src/m_misc.c')
-rw-r--r-- | src/m_misc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/m_misc.c b/src/m_misc.c index acab0a5b..9a5fb84a 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -198,3 +198,11 @@ char *M_TempFile(char *s) return result; } +boolean M_StrToInt(const char *str, int *result) +{ + return sscanf(str, " 0x%x", result) == 1 + || sscanf(str, " 0X%x", result) == 1 + || sscanf(str, " 0%o", result) == 1 + || sscanf(str, " %d", result) == 1; +} + |