projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
95a9d30
)
* abort token extraction if increasebuf won't let us continue (constbufs for extracti...
author
Wilfried Göesgens
<willi@citadel.org>
Sun, 12 Jul 2009 11:04:22 +0000
(11:04 +0000)
committer
Wilfried Göesgens
<willi@citadel.org>
Sun, 12 Jul 2009 11:04:22 +0000
(11:04 +0000)
libcitadel/lib/stringbuf.c
patch
|
blob
|
history
diff --git
a/libcitadel/lib/stringbuf.c
b/libcitadel/lib/stringbuf.c
index 599b482c0d9b6ff0475fb4cd301429daeb1864e4..1cc92269a4878c2985a008727640fa1f2f3daddb 100644
(file)
--- a/
libcitadel/lib/stringbuf.c
+++ b/
libcitadel/lib/stringbuf.c
@@
-1194,8
+1194,10
@@
int StrBufExtract_token(StrBuf *dest, const StrBuf *Source, int parmnum, char se
}
if (len >= dest->BufSize) {
dest->BufUsed = len;
- if (!IncreaseBuf(dest, 1, -1))
+ if (IncreaseBuf(dest, 1, -1) < 0) {
+ dest->BufUsed --;
break;
+ }
}
if ( (current_token == parmnum) &&
(*s != separator)) {
@@
-1299,7
+1301,6
@@
unsigned long StrBufExtract_unsigned_long(const StrBuf* Source, int parmnum, cha
}
-
/**
* \brief a string tokenizer
* \param dest Destination StringBuffer
@@
-1347,8
+1348,10
@@
int StrBufExtract_NextToken(StrBuf *dest, const StrBuf *Source, const char **pSt
}
if (len >= dest->BufSize) {
dest->BufUsed = len;
- if (!IncreaseBuf(dest, 1, -1)) {
+
+ if (IncreaseBuf(dest, 1, -1) < 0) {
*pStart = EndBuffer + 1;
+ dest->BufUsed --;
break;
}
}