Small updates.

committer: mfx <mfx> 1031793636 +0000
This commit is contained in:
Markus F.X.J. Oberhumer 2002-09-12 01:20:36 +00:00
parent 9f4a0fedbf
commit 6b74aa2673
2 changed files with 13 additions and 3 deletions

View File

@ -958,7 +958,7 @@ void Packer::initLoader(const void *pdata, int plen, int pinfo)
pinfo = (pinfo + 3) &~ 3;
}
delete linker;
delete linker; linker = NULL;
if (getFormat() < 128)
linker = new Linker(pdata, plen, pinfo); // little endian
else

View File

@ -143,12 +143,22 @@ static const char *mkline(unsigned long fu_len, unsigned long fc_len,
bool decompress=false)
{
static char buf[2000];
char r[7+1];
char r[7+1] = "";
char fn[13+1];
const char *f;
// Large ratios can happen because of overlays that are
// appended after a program is packed.
unsigned ratio = get_ratio(fu_len, fc_len);
upx_snprintf(r, sizeof(r), "%3d.%02d%%", ratio / 10000, (ratio % 10000) / 100);
#if 1
if (ratio >= 1000*1000)
strcpy(r, "overlay");
#else
if (ratio >= 10*1000*1000) // >= "1000%"
strcpy(r, "999.99%");
#endif
else
upx_snprintf(r, sizeof(r), "%3d.%02d%%", ratio / 10000, (ratio % 10000) / 100);
if (decompress)
f = "%10ld <-%10ld %7s %13s %s";
else