diff options
-rw-r--r-- | usr.bin/ar/archive.c | 3 | ||||
-rw-r--r-- | usr.bin/ar/misc.c | 6 |
2 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/ar/archive.c b/usr.bin/ar/archive.c index 2d31b2f..8a6fe2f 100644 --- a/usr.bin/ar/archive.c +++ b/usr.bin/ar/archive.c @@ -299,7 +299,8 @@ copy_ar(cfp, size) error(cfp->rname); } - if (cfp->flags & RPAD && size & 1 && (nr = read(from, buf, 1)) != 1) { + if (cfp->flags & RPAD && (size + chdr.lname) & 1 && + (nr = read(from, buf, 1)) != 1) { if (nr == 0) badfmt(); error(cfp->rname); diff --git a/usr.bin/ar/misc.c b/usr.bin/ar/misc.c index d182fa9..4faaa22 100644 --- a/usr.bin/ar/misc.c +++ b/usr.bin/ar/misc.c @@ -126,10 +126,8 @@ int compare(dest) char *dest; { - - if (options & AR_TR) - return (!strncmp(chdr.name, rname(dest), OLDARMAXNAME)); - return (!strcmp(chdr.name, rname(dest))); + int maxname = (options & AR_TR) ? OLDARMAXNAME : MAXNAMLEN; + return (!strncmp(chdr.name, rname(dest), maxname)); } void |