From 1db0393eb132ff6ecb85747d4a440072755959f8 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 26 Dec 2014 06:09:11 +0000 Subject: uninitialized variable * process.c (rb_spawn_process): get rid of usage of uninitialized variable. reported by Denis Denisov . * regexec.c (match_at): ditto. * ext/win32ole/win32ole.c (ole_wc2mb_alloc, ole_vstr2wc, ole_mb2wc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49025 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- regexec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'regexec.c') diff --git a/regexec.c b/regexec.c index 1ec337fdc1..299c3161a5 100644 --- a/regexec.c +++ b/regexec.c @@ -1408,8 +1408,9 @@ match_at(regex_t* reg, const UChar* str, const UChar* end, int len; fprintf(stderr, "%4"PRIdPTR"> \"", (*p == OP_FINISH) ? (ptrdiff_t )-1 : s - str); bp = buf; + q = s; if (*p != OP_FINISH) { /* s may not be a valid pointer if OP_FINISH. */ - for (i = 0, q = s; i < 7 && q < end; i++) { + for (i = 0; i < 7 && q < end; i++) { len = enclen(encode, q, end); while (len-- > 0) *bp++ = *q++; } -- cgit v1.2.1