aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/tar.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2010-07-11 09:48:51 -0700
committerRuss Cox <rsc@swtch.com>2010-07-11 09:48:51 -0700
commitd67dc856d17c2e0491edccc20de8757ab4d59641 (patch)
treef818277c17734e9d82f160dd3e3832a11ff50dc4 /src/cmd/tar.c
parentc006e984192aa8bcb755bdd25e111bb37b5db16b (diff)
downloadplan9port-d67dc856d17c2e0491edccc20de8757ab4d59641.tar.gz
plan9port-d67dc856d17c2e0491edccc20de8757ab4d59641.tar.bz2
plan9port-d67dc856d17c2e0491edccc20de8757ab4d59641.zip
tar: rename sstrnlen to avoid OpenBSD compile error
R=, rsc CC= http://codereview.appspot.com/1810041
Diffstat (limited to 'src/cmd/tar.c')
-rw-r--r--src/cmd/tar.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/cmd/tar.c b/src/cmd/tar.c
index 70ea8e0e..934fba9d 100644
--- a/src/cmd/tar.c
+++ b/src/cmd/tar.c
@@ -423,7 +423,7 @@ isustar(Hdr *hp)
* be NUL.
*/
static int
-sstrnlen(char *s, int n)
+tar_sstrnlen(char *s, int n)
{
return s[n - 1] != '\0'? n: strlen(s);
}
@@ -437,7 +437,7 @@ name(Hdr *hp)
char *fullname;
fullname = fullnamebuf+2;
- namlen = sstrnlen(hp->name, sizeof hp->name);
+ namlen = tar_sstrnlen(hp->name, sizeof hp->name);
if (hp->prefix[0] == '\0' || !isustar(hp)) { /* old-style name? */
memmove(fullname, hp->name, namlen);
fullname[namlen] = '\0';
@@ -445,7 +445,7 @@ name(Hdr *hp)
}
/* name is in two pieces */
- pfxlen = sstrnlen(hp->prefix, sizeof hp->prefix);
+ pfxlen = tar_sstrnlen(hp->prefix, sizeof hp->prefix);
memmove(fullname, hp->prefix, pfxlen);
fullname[pfxlen] = '/';
memmove(fullname + pfxlen + 1, hp->name, namlen);
@@ -539,8 +539,8 @@ readhdr(int ar)
return nil;
hdrcksum = strtoul(hp->chksum, nil, 8);
if (chksum(hp) != hdrcksum)
- sysfatal("bad archive header checksum: name %.64s...",
- hp->name);
+ sysfatal("bad archive header checksum: name %.64s... %ld %ld",
+ hp->name, chksum(hp), hdrcksum);
nexthdr += Tblock*(1 + BYTES2TBLKS(arsize(hp)));
return hp;
}