aboutsummaryrefslogtreecommitdiff
path: root/src/printf.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-03-20 16:30:17 +0000
committerdrh <drh@noemail.net>2008-03-20 16:30:17 +0000
commitb1a6c3c1cc41f16693c0b0855c27e5429e6867a2 (patch)
tree36c78d4910bf0bc7b43d595b69dade6d77b21a5a /src/printf.c
parent81a392f7d79f17c411027c27b899ed6c8d72c519 (diff)
downloadsqlite-b1a6c3c1cc41f16693c0b0855c27e5429e6867a2.tar.gz
sqlite-b1a6c3c1cc41f16693c0b0855c27e5429e6867a2.zip
Reinstate test cases for the limit tests. The sqlite3_limit() API is now
tested and working. (CVS 4899) FossilOrigin-Name: 4c4be4c3c8aae97f1d85442b25afba9f0b02c8b3
Diffstat (limited to 'src/printf.c')
-rw-r--r--src/printf.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/printf.c b/src/printf.c
index 2cd02a851..4e7525798 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -735,14 +735,17 @@ void sqlite3StrAccumAppend(StrAccum *p, const char *z, int N){
return;
}
}else{
- p->nAlloc += p->nAlloc + N + 1;
- if( p->nAlloc > p->mxAlloc ){
+ i64 szNew = p->nAlloc;
+ szNew += N + 1;
+ if( szNew > p->mxAlloc ){
p->nAlloc = p->mxAlloc;
- if( p->nChar+N >= p->nAlloc ){
+ if( ((i64)p->nChar)+((i64)N) >= p->nAlloc ){
sqlite3StrAccumReset(p);
p->tooBig = 1;
return;
}
+ }else{
+ p->nAlloc = szNew;
}
zNew = sqlite3_malloc( p->nAlloc );
if( zNew ){