projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4a992ca
)
simple function to check if entire buffer is purely numbers
author
Matt
<matt@uncensored.citadel.org>
Sun, 14 Dec 2008 11:59:51 +0000
(11:59 +0000)
committer
Matt
<matt@uncensored.citadel.org>
Sun, 14 Dec 2008 11:59:51 +0000
(11:59 +0000)
libcitadel/lib/stringbuf.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/stringbuf.c
b/libcitadel/lib/stringbuf.c
index 03632033602ac168d5885644b067159671735ca2..db6a3b12b7a5c5cb90009813a48715afb7611ada 100644
(file)
--- a/
libcitadel/lib/stringbuf.c
+++ b/
libcitadel/lib/stringbuf.c
@@
-291,7
+291,14
@@
int StrToi(const StrBuf *Buf)
else
return 0;
}
-
+/**
+ * \brief Checks to see if the string is a pure number
+ */
+int StrBufIsNumber(const StrBuf *Buf) {
+ char * pEnd;
+ strtoll(Buf->buf, &pEnd, 10);
+ return (strlen(pEnd) > 0) ? 0 : 1;
+}
/**
* \brief modifies a Single char of the Buf
* You can point to it via char* or a zero-based integer