]> granicus.if.org Git - onig/commitdiff
fix: index of callout list entry is callout num - 1
authorK.Kosako <kosako@sofnec.co.jp>
Tue, 13 Mar 2018 09:04:49 +0000 (18:04 +0900)
committerK.Kosako <kosako@sofnec.co.jp>
Tue, 13 Mar 2018 09:04:49 +0000 (18:04 +0900)
src/regparse.c

index 548af15d4a3f0db47fbe5ea2717a22a4ceca4bdc..5e1012c235c22ee733c534848f6eed8e8e4a0999 100644 (file)
@@ -1707,9 +1707,11 @@ typedef intptr_t   CalloutTagVal;
 static int
 i_callout_callout_list_set(UChar* key, CalloutTagVal e, void* arg)
 {
+  int num;
   RegexExt* ext = (RegexExt* )arg;
 
-  ext->callout_list[e].flag |= CALLOUT_TAG_LIST_FLAG_TAG_EXIST;
+  num = (int )e - 1;
+  ext->callout_list[num].flag |= CALLOUT_TAG_LIST_FLAG_TAG_EXIST;
   return ST_CONTINUE;
 }