aboutsummaryrefslogtreecommitdiff
path: root/ext/fts5/fts5_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fts5/fts5_buffer.c')
-rw-r--r--ext/fts5/fts5_buffer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/fts5/fts5_buffer.c b/ext/fts5/fts5_buffer.c
index 07e1243c3..1a7c0d0f8 100644
--- a/ext/fts5/fts5_buffer.c
+++ b/ext/fts5/fts5_buffer.c
@@ -16,12 +16,14 @@
#include "fts5Int.h"
int sqlite3Fts5BufferGrow(int *pRc, Fts5Buffer *pBuf, int nByte){
- /* A no-op if an error has already occurred */
- if( *pRc ) return 1;
if( (pBuf->n + nByte) > pBuf->nSpace ){
u8 *pNew;
int nNew = pBuf->nSpace ? pBuf->nSpace*2 : 64;
+
+ /* A no-op if an error has already occurred */
+ if( *pRc ) return 1;
+
while( nNew<(pBuf->n + nByte) ){
nNew = nNew * 2;
}