From: K.Kosako Date: Wed, 2 Jan 2019 12:30:33 +0000 (+0900) Subject: fix #127: Windows VS 2008 build errors X-Git-Tag: v6.9.2_rc1~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b054054866bf8df0da826830f1caa244f4806a82;p=onig fix #127: Windows VS 2008 build errors --- diff --git a/src/regparse.c b/src/regparse.c index 90c3749..1378eea 100644 --- a/src/regparse.c +++ b/src/regparse.c @@ -1565,9 +1565,13 @@ onig_set_callout_of_name(OnigEncoding enc, OnigCalloutType callout_type, } for (i = arg_num - opt_arg_num, j = 0; i < arg_num; i++, j++) { if (fe->arg_types[i] == ONIG_TYPE_STRING) { + OnigValue* val; + UChar* ds; + if (IS_NULL(opt_defaults)) return ONIGERR_INVALID_ARGUMENT; - OnigValue* val = opt_defaults + j; - UChar* ds = onigenc_strdup(enc, val->s.start, val->s.end); + + val = opt_defaults + j; + ds = onigenc_strdup(enc, val->s.start, val->s.end); CHECK_NULL_RETURN_MEMERR(ds); fe->opt_defaults[i].s.start = ds;