aboutsummaryrefslogtreecommitdiff
path: root/src/test_regexp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test_regexp.c')
-rw-r--r--src/test_regexp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/test_regexp.c b/src/test_regexp.c
index 2cebbea44..a1969ada4 100644
--- a/src/test_regexp.c
+++ b/src/test_regexp.c
@@ -107,7 +107,7 @@ struct ReCompiled {
char *aOp; /* Operators for the virtual machine */
int *aArg; /* Arguments to each operator */
unsigned (*xNextChar)(ReInput*); /* Next character function */
- char zInit[12]; /* Initial text to match */
+ unsigned char zInit[12]; /* Initial text to match */
int nInit; /* Number of characters in zInit */
unsigned nState; /* Number of entries in aOp[] and aArg[] */
unsigned nAlloc; /* Slots allocated for aOp[] and aArg[] */
@@ -194,7 +194,8 @@ int re_match(ReCompiled *pRe, const unsigned char *zIn, int nIn){
if( pRe->nInit ){
unsigned char x = pRe->zInit[0];
while( in.i+pRe->nInit<=in.mx
- && (zIn[in.i]!=x || strncmp(zIn+in.i, pRe->zInit, pRe->nInit)!=0)
+ && (zIn[in.i]!=x ||
+ strncmp((const char*)zIn+in.i, (const char*)pRe->zInit, pRe->nInit)!=0)
){
in.i++;
}