Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
Fix #12
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Apr 14, 2018
1 parent dfa46f8 commit 09432e4
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/archives/deb.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,27 @@ void scan_deb() {
struct deb_hdr h;
struct deb_data_hdr dh;

_ddread(&h, sizeof(h) + sizeof(dh));
if (strcmp(h.file_iden, DEBIANBIN)) {
_ddread(&h, sizeof(h));
if (strncmp(h.file_iden, DEBIANBIN, sizeof(DEBIANBIN) - 1)) {
report_text();
return;
}

long deb_fsize = strtol(h.ctl_filesize, NULL, sizeof(h.ctl_filesize));
long ctl_fsize = strtol(dh.filesize, NULL, sizeof(dh.filesize));
long dfsize = strtol(h.ctl_filesize, NULL, sizeof(h.ctl_filesize));
if (dfsize) {
_ddseek(dfsize, SEEK_CUR);
_ddread(&dh, sizeof(dh));
}

long cfsize = strtol(dh.filesize, NULL, sizeof(dh.filesize));
_debslice(h.ctl_file_ident, sizeof(h.ctl_file_ident));
//_debslice(dh.file_ident, sizeof(dh.file_ident));
_debslice(dh.file_ident, sizeof(dh.file_ident));

reportn("Debian package v");
printf("%.3s", h.version);
printf(", %s (", h.ctl_file_ident);
_printfd(deb_fsize);
_printfd(dfsize);
printf("), %s (", dh.file_ident);
_printfd(ctl_fsize);
_printfd(cfsize);
puts(")");
}

0 comments on commit 09432e4

Please # to comment.