diff options
author | Albert Lee <trisk@acm.jhu.edu> | 2008-12-01 19:41:36 -0500 |
---|---|---|
committer | Albert Lee <trisk@acm.jhu.edu> | 2008-12-01 19:41:36 -0500 |
commit | 1a22c43f78a9accbcfcffca1b0e3718e4d90e869 (patch) | |
tree | 1a0dbb7c7d2c50afc2e6cc9a6d5fb73669b18176 /src/cmd/tar.c | |
parent | 112a2c5892067edbd48c020caec80fa455c0d07b (diff) | |
download | plan9port-1a22c43f78a9accbcfcffca1b0e3718e4d90e869.tar.gz plan9port-1a22c43f78a9accbcfcffca1b0e3718e4d90e869.tar.bz2 plan9port-1a22c43f78a9accbcfcffca1b0e3718e4d90e869.zip |
src/cmd/tar.c: avoid conflict with strnlen in libc
Diffstat (limited to 'src/cmd/tar.c')
-rw-r--r-- | src/cmd/tar.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/tar.c b/src/cmd/tar.c index 42dbef15..70ea8e0e 100644 --- a/src/cmd/tar.c +++ b/src/cmd/tar.c @@ -423,7 +423,7 @@ isustar(Hdr *hp) * be NUL. */ static int -strnlen(char *s, int n) +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 = strnlen(hp->name, sizeof hp->name); + namlen = 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 = strnlen(hp->prefix, sizeof hp->prefix); + pfxlen = sstrnlen(hp->prefix, sizeof hp->prefix); memmove(fullname, hp->prefix, pfxlen); fullname[pfxlen] = '/'; memmove(fullname + pfxlen + 1, hp->name, namlen); |