Make a for loop in uuencode less dumb

This commit is contained in:
Thomas Goyne 2014-03-18 13:41:26 -07:00
parent 59e8ec522e
commit 3ef8fa9ec0
1 changed files with 2 additions and 2 deletions

View File

@ -32,8 +32,8 @@ namespace agi {
for (size_t pos = 0; pos + 1 < len; ) {
size_t bytes = 0;
unsigned char src[4] = { '\0', '\0', '\0', '\0' };
for (size_t i = 0; i < 4 && pos < len; ) {
char c = str[pos++];
for (size_t i = 0; i < 4 && pos < len; ++pos) {
char c = str[pos];
if (c && c != '\n' && c != '\r') {
src[i++] = c - 33;
++bytes;