diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/os.c | 1 | ||||
-rw-r--r-- | src/shell.c.in | 8 |
2 files changed, 5 insertions, 4 deletions
@@ -161,6 +161,7 @@ int sqlite3OsSectorSize(sqlite3_file *id){ return (xSectorSize ? xSectorSize(id) : SQLITE_DEFAULT_SECTOR_SIZE); } int sqlite3OsDeviceCharacteristics(sqlite3_file *id){ + if( NEVER(id->pMethods==0) ) return 0; return id->pMethods->xDeviceCharacteristics(id); } #ifndef SQLITE_OMIT_WAL diff --git a/src/shell.c.in b/src/shell.c.in index 015d71aad..cf04378db 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -3183,9 +3183,9 @@ static void exec_prepared_stmt_columnar( z = (const char*)sqlite3_column_text(pStmt,i); azData[nRow*nColumn + i] = z ? strdup(z) : 0; } - }while( (rc = sqlite3_step(pStmt))==SQLITE_ROW ); + }while( sqlite3_step(pStmt)==SQLITE_ROW ); if( nColumn>p->nWidth ){ - p->colWidth = realloc(p->colWidth, nColumn*2*sizeof(int)); + p->colWidth = realloc(p->colWidth, (nColumn+1)*2*sizeof(int)); if( p->colWidth==0 ) shell_out_of_memory(); for(i=p->nWidth; i<nColumn; i++) p->colWidth[i] = 0; p->nWidth = nColumn; @@ -5385,7 +5385,7 @@ static void tryToCloneSchema( zQuery); goto end_schema_xfer; } - while( (rc = sqlite3_step(pQuery))==SQLITE_ROW ){ + while( sqlite3_step(pQuery)==SQLITE_ROW ){ zName = sqlite3_column_text(pQuery, 0); zSql = sqlite3_column_text(pQuery, 1); printf("%s... ", zName); fflush(stdout); @@ -10595,7 +10595,7 @@ static int do_meta_command(char *zLine, ShellState *p){ int j; assert( nArg<=ArraySize(azArg) ); p->nWidth = nArg-1; - p->colWidth = realloc(p->colWidth, p->nWidth*sizeof(int)*2); + p->colWidth = realloc(p->colWidth, (p->nWidth+1)*sizeof(int)*2); if( p->colWidth==0 && p->nWidth>0 ) shell_out_of_memory(); if( p->nWidth ) p->actualWidth = &p->colWidth[p->nWidth]; for(j=1; j<nArg; j++){ |