Slight code reduction.

This commit is contained in:
mycroft 1998-07-27 17:55:17 +00:00
parent 5582b71d91
commit ac70c0c5ed
5 changed files with 14 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: err.c,v 1.9 1998/07/27 15:32:04 mycroft Exp $ */
/* $NetBSD: err.c,v 1.10 1998/07/27 17:55:17 mycroft Exp $ */
/*-
* Copyright (c) 1980, 1991, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)err.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: err.c,v 1.9 1998/07/27 15:32:04 mycroft Exp $");
__RCSID("$NetBSD: err.c,v 1.10 1998/07/27 17:55:17 mycroft Exp $");
#endif
#endif /* not lint */
@ -312,8 +312,7 @@ seterror(id, va_alist)
#endif
if (id < 0 || id > sizeof(errorlist) / sizeof(errorlist[0]))
id = ERR_INVALID;
vsnprintf(berr, sizeof(berr) - 1, errorlist[id], va);
berr[sizeof(berr) - 1] = '\0';
vsnprintf(berr, sizeof(berr), errorlist[id], va);
va_end(va);
seterr = strsave(berr);

View File

@ -1,4 +1,4 @@
/* $NetBSD: expr.c,v 1.6 1998/07/27 17:06:48 mycroft Exp $ */
/* $NetBSD: expr.c,v 1.7 1998/07/27 17:55:17 mycroft Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
@ -175,7 +175,6 @@ to_string(vp)
err(2, "%s", "");
}
(void)snprintf(tmp, 25, "%d", vp->u.i);
tmp[24] = '\0';
vp->type = string;
vp->u.s = tmp;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ls.c,v 1.27 1998/07/27 17:06:48 mycroft Exp $ */
/* $NetBSD: ls.c,v 1.28 1998/07/27 17:55:17 mycroft Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)ls.c 8.7 (Berkeley) 8/5/94";
#else
__RCSID("$NetBSD: ls.c,v 1.27 1998/07/27 17:06:48 mycroft Exp $");
__RCSID("$NetBSD: ls.c,v 1.28 1998/07/27 17:55:17 mycroft Exp $");
#endif
#endif /* not lint */
@ -478,8 +478,10 @@ display(p, list)
btotal += sp->st_blocks;
if (f_longform) {
if (f_numericonly) {
snprintf(nuser, 12, "%u", sp->st_uid);
snprintf(ngroup, 12, "%u", sp->st_gid);
snprintf(nuser, sizeof(nuser), "%u",
sp->st_uid);
snprintf(ngroup, sizeof(ngroup), "%u",
sp->st_gid);
user = nuser;
group = ngroup;
} else {

View File

@ -1,4 +1,4 @@
/* $NetBSD: cache.c,v 1.8 1998/07/27 16:43:25 mycroft Exp $ */
/* $NetBSD: cache.c,v 1.9 1998/07/27 17:55:17 mycroft Exp $ */
/*-
* Copyright (c) 1992 Keith Muller.
@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)cache.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: cache.c,v 1.8 1998/07/27 16:43:25 mycroft Exp $");
__RCSID("$NetBSD: cache.c,v 1.9 1998/07/27 17:55:17 mycroft Exp $");
#endif
#endif /* not lint */
@ -255,7 +255,6 @@ name_uid(uid, frc)
# else
(void)snprintf(ptr->name, UNMLEN, "%lu", (long) uid);
# endif
ptr->name[UNMLEN-1] = '\0';
ptr->valid = INVALID;
if (frc == 0)
return("");
@ -333,7 +332,6 @@ name_gid(gid, frc)
# else
(void)snprintf(ptr->name, GNMLEN, "%lu", (long) gid);
# endif
ptr->name[GNMLEN-1] = '\0';
ptr->valid = INVALID;
if (frc == 0)
return("");

View File

@ -1,4 +1,4 @@
/* $NetBSD: print.c,v 1.17 1998/07/27 16:55:53 mycroft Exp $ */
/* $NetBSD: print.c,v 1.18 1998/07/27 17:55:17 mycroft Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)print.c 8.6 (Berkeley) 4/16/94";
#else
__RCSID("$NetBSD: print.c,v 1.17 1998/07/27 16:55:53 mycroft Exp $");
__RCSID("$NetBSD: print.c,v 1.18 1998/07/27 17:55:17 mycroft Exp $");
#endif
#endif /* not lint */
@ -209,8 +209,6 @@ print(tp, wp, ldisc, fmt)
}
}
if (cnt) {
buf1[cnt * 8] = '\0';
buf2[cnt * 8] = '\0';
(void)printf("%s\n", buf1);
(void)printf("%s\n", buf2);
}