fixed possible overrun bug

This commit is contained in:
David Anderson 2006-02-24 00:11:37 +00:00
parent 6997c780d9
commit 0520c606ec

View File

@ -390,15 +390,21 @@ reswitch:
} }
case '%': case '%':
*buf_p++ = static_cast<D>(ch); *buf_p++ = static_cast<D>(ch);
if (!llen)
goto done;
llen--; llen--;
break; break;
case '\0': case '\0':
*buf_p++ = static_cast<D>('%'); *buf_p++ = static_cast<D>('%');
if (!llen)
goto done;
llen--; llen--;
goto done; goto done;
break; break;
default: default:
*buf_p++ = static_cast<D>(ch); *buf_p++ = static_cast<D>(ch);
if (!llen)
goto done;
llen--; llen--;
break; break;
} }