make uudecode print offsets, too

master
leitner 18 years ago
parent a2900d45a6
commit 0e190f60ab

@ -309,11 +309,13 @@ invalidpart:
if (tmp) { if (tmp) {
if (!scan_xlong(tmp+8,&wantedcrc)) if (!scan_xlong(tmp+8,&wantedcrc))
goto invalidpart; goto invalidpart;
wantedcrc &= 0xfffffffful;
} else if (part==1) { } else if (part==1) {
tmp=strstr(line," crc32="); tmp=strstr(line," crc32=");
if (!tmp) goto invalidpart; if (!tmp) goto invalidpart;
if (!scan_xlong(tmp+7,&wantedcrc)) if (!scan_xlong(tmp+7,&wantedcrc))
goto invalidpart; goto invalidpart;
wantedcrc &= 0xfffffffful;
endoffset=totalsize; endoffset=totalsize;
} else goto invalidpart; } else goto invalidpart;
stralloc_init(&out); stralloc_init(&out);
@ -349,6 +351,15 @@ writeerror:
buffer_puts(buffer_2,"warning: part "); buffer_puts(buffer_2,"warning: part ");
buffer_putulong(buffer_2,part); buffer_putulong(buffer_2,part);
buffer_putsflush(buffer_2," corrupt; reconstruction failed.\n"); buffer_putsflush(buffer_2," corrupt; reconstruction failed.\n");
buffer_puts(buffer_2," -> ");
buffer_putulong(buffer_2,offset);
buffer_puts(buffer_2,"-");
buffer_putulong(buffer_2,endoffset);
buffer_puts(buffer_2," (want crc ");
buffer_putxlong(buffer_2,wantedcrc);
buffer_puts(buffer_2,", got crc ");
buffer_putxlong(buffer_2,i);
buffer_putsflush(buffer_2,")\n");
if (buffer_put(&fileout,out.s,out.len)) goto writeerror; if (buffer_put(&fileout,out.s,out.len)) goto writeerror;
} }
} }

Loading…
Cancel
Save