if(mode!=JISX0208)
switch_mode(JISX0208, buf);
- char jbuf[2] = { jis.ku+0x20, jis.ten+0x20 };
+ char jbuf[2];
+ jbuf[0] = jis.ku+0x20;
+ jbuf[1] = jis.ten+0x20;
buf.append(jbuf, 2);
}
}
result += "\\\\";
else if(static_cast<unsigned char>(*i)<' ' || (escape_8bit && (*i&0x80)))
{
- char buf[4] = {'\\', '0'+((*i>>6)&3), '0'+((*i>>3)&7), '0'+(*i&7)};
+ char buf[4] = { '\\', 0 };
+ for(unsigned j=0; j<3; ++j)
+ buf[1+j] = '0'+((static_cast<unsigned char>(*i)>>(6-j*3))&7);
result.append(buf, 4);
}
else