Issue #12202 has been updated by Tomoyuki Chikanaga.

Backport changed from 2.1: WONTFIX, 2.2: DONE, 2.3: REQUIRED to 2.1: WONTFIX, 2.2: DONE, 2.3: DONE

ruby_2_3 r54714 merged revision(s) 54423,54489.

----------------------------------------
Bug #12202: nkf.c  static void mime_putc the variable being used for loop used for outer loop too
https://bugs.ruby-lang.org/issues/12202#change-58271

* Author: Anton Sivakov
* Status: Closed
* Priority: Normal
* Assignee: 
* ruby -v: 
* Backport: 2.1: WONTFIX, 2.2: DONE, 2.3: DONE
----------------------------------------
~~~
for (i=0;i<mimeout_state.count;i++) {
  if (SP<mimeout_state.buf[i] && mimeout_state.buf[i]<DEL) {
    eof_mime();
    for (i=0;i<mimeout_state.count;i++) {
      (*o_mputc)(mimeout_state.buf[i]);
      base64_count++;
    }
    mimeout_state.count = 0;
  }
}
~~~

Variable 'i' here used for outer and inner loop.
Also variable mimeout_state.count can be changed within a loop it can affect outer loop



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>