summaryrefslogtreecommitdiff
path: root/bin/pax/gen_subs.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-05-16 03:05:00 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-05-16 03:05:00 +0000
commita6cba63b13007c47209fca64dbe16f5d594493bf (patch)
treec41d9a1481c80fc5dd38a3f34c78b2bdd6e1dd8b /bin/pax/gen_subs.c
parent11041f947a8a8c2fabec695efdb740beb263a3bb (diff)
use proper str*cpy functions instead of home grown one, spaces; millert@ ok
Diffstat (limited to 'bin/pax/gen_subs.c')
-rw-r--r--bin/pax/gen_subs.c45
1 files changed, 6 insertions, 39 deletions
diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c
index acbcc54fac6..967afe571d1 100644
--- a/bin/pax/gen_subs.c
+++ b/bin/pax/gen_subs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gen_subs.c,v 1.9 2001/02/12 13:51:15 danh Exp $ */
+/* $OpenBSD: gen_subs.c,v 1.10 2001/05/16 03:04:57 mickey Exp $ */
/* $NetBSD: gen_subs.c,v 1.5 1995/03/21 09:07:26 cgd Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)gen_subs.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: gen_subs.c,v 1.9 2001/02/12 13:51:15 danh Exp $";
+static char rcsid[] = "$OpenBSD: gen_subs.c,v 1.10 2001/05/16 03:04:57 mickey Exp $";
#endif
#endif /* not lint */
@@ -127,7 +127,7 @@ ls_list(arcn, now, fp)
if (strftime(f_date,DATELEN,timefrmt,localtime(&(sbp->st_mtime))) == 0)
f_date[0] = '\0';
(void)fprintf(fp, "%s%2u %-*.*s %-*.*s ", f_mode, sbp->st_nlink,
- NAME_WIDTH, UT_NAMESIZE, name_uid(sbp->st_uid, 1),
+ NAME_WIDTH, UT_NAMESIZE, name_uid(sbp->st_uid, 1),
NAME_WIDTH, UT_NAMESIZE, name_gid(sbp->st_gid, 1));
/*
@@ -164,7 +164,7 @@ ls_list(arcn, now, fp)
/*
* tty_ls()
- * print a short summary of file to tty.
+ * print a short summary of file to tty.
*/
#ifdef __STDC__
@@ -203,39 +203,6 @@ ls_tty(arcn)
}
/*
- * l_strncpy()
- * copy src to dest up to len chars (stopping at first '\0').
- * when src is shorter than len, pads to len with '\0'.
- * Return:
- * number of chars copied. (Note this is a real performance win over
- * doing a strncpy(), a strlen(), and then a possible memset())
- */
-
-#ifdef __STDC__
-int
-l_strncpy(register char *dest, register char *src, int len)
-#else
-int
-l_strncpy(dest, src, len)
- register char *dest;
- register char *src;
- int len;
-#endif
-{
- register char *stop;
- register char *start;
-
- stop = dest + len;
- start = dest;
- while ((dest < stop) && (*src != '\0'))
- *dest++ = *src++;
- len = dest - start;
- while (dest < stop)
- *dest++ = '\0';
- return(len);
-}
-
-/*
* asc_ul()
* convert hex/octal character string into a u_long. We do not have to
* check for overflow! (the headers in all supported formats are not large
@@ -283,7 +250,7 @@ asc_ul(str, len, base)
break;
}
} else {
- while ((str < stop) && (*str >= '0') && (*str <= '7'))
+ while ((str < stop) && (*str >= '0') && (*str <= '7'))
tval = (tval << 3) + (*str++ - '0');
}
return(tval);
@@ -397,7 +364,7 @@ asc_uqd(str, len, base)
break;
}
} else {
- while ((str < stop) && (*str >= '0') && (*str <= '7'))
+ while ((str < stop) && (*str >= '0') && (*str <= '7'))
tval = (tval << 3) + (*str++ - '0');
}
return(tval);