aboutsummaryrefslogtreecommitdiff
path: root/ext/misc/csv.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2017-09-18 00:18:31 +0000
committerdrh <drh@noemail.net>2017-09-18 00:18:31 +0000
commit2acd24d90c7b47436bc744f07ae2d714abd13e62 (patch)
treeca2fd42d0bfca10936b87550cb3d362031e9ad0d /ext/misc/csv.c
parent97258194a2eb054822fbb8ff6cf4d285458f5513 (diff)
downloadsqlite-2acd24d90c7b47436bc744f07ae2d714abd13e62.tar.gz
sqlite-2acd24d90c7b47436bc744f07ae2d714abd13e62.zip
Fix the CSV virtual table extension so that it works when the default character
is unsigned. FossilOrigin-Name: 42f07775556758754e92e29a759d200d0d81d16eee83ab982b840db11292f834
Diffstat (limited to 'ext/misc/csv.c')
-rw-r--r--ext/misc/csv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/misc/csv.c b/ext/misc/csv.c
index 1eafc3a41..c634ab3a4 100644
--- a/ext/misc/csv.c
+++ b/ext/misc/csv.c
@@ -78,7 +78,7 @@ struct CsvReader {
int nAlloc; /* Space allocated for z[] */
int nLine; /* Current line number */
int bNotFirst; /* True if prior text has been seen */
- char cTerm; /* Character that terminated the most recent field */
+ int cTerm; /* Character that terminated the most recent field */
size_t iIn; /* Next unread character in the input buffer */
size_t nIn; /* Number of characters in the input buffer */
char *zIn; /* The input buffer */
@@ -166,7 +166,7 @@ static int csv_getc(CsvReader *p){
if( p->in!=0 ) return csv_getc_refill(p);
return EOF;
}
- return p->zIn[p->iIn++];
+ return ((unsigned char*)p->zIn)[p->iIn++];
}
/* Increase the size of p->z and append character c to the end.