diff --git a/app/lua/ldump.c b/app/lua/ldump.c index 1c5d5b7b..7681fed6 100644 --- a/app/lua/ldump.c +++ b/app/lua/ldump.c @@ -47,7 +47,7 @@ static void DumpChar(int y, DumpState* D) static void Align4(DumpState *D) { - while(D->wrote&3) + while(D->wrote&3 && D->status==0) DumpChar(0,D); } diff --git a/app/uzlib/uzlib_deflate.c b/app/uzlib/uzlib_deflate.c index 27e5d8fe..f393da33 100644 --- a/app/uzlib/uzlib_deflate.c +++ b/app/uzlib/uzlib_deflate.c @@ -201,7 +201,7 @@ static void genCodeRecs (const codeRecord *rec, ushort len, for (i = start; i < start+len; i++, c++) { if (*c == 0xFF) b++, c++; - m +=!(*c & 0x80) ? *c & 0x7F : 2 << *c; + m += (*c & 0x80) ? 2 << (*c & 0x1F) : *c; *p++ = (codeRecord) {i, b, last + 1, (last = m)}; } }