use bounded string op

This commit is contained in:
itojun 2003-07-13 08:23:39 +00:00
parent 49fbaf537e
commit 6950184129
2 changed files with 6 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mv.c,v 1.28 2002/12/26 21:37:17 jrf Exp $ */
/* $NetBSD: mv.c,v 1.29 2003/07/13 08:25:47 itojun Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94";
#else
__RCSID("$NetBSD: mv.c,v 1.28 2002/12/26 21:37:17 jrf Exp $");
__RCSID("$NetBSD: mv.c,v 1.29 2003/07/13 08:25:47 itojun Exp $");
#endif
#endif /* not lint */
@ -124,7 +124,7 @@ main(int argc, char *argv[])
}
/* It's a directory, move each file into it. */
(void)strcpy(path, argv[argc - 1]);
(void)strlcpy(path, argv[argc - 1], sizeof(path));
baselen = strlen(path);
endp = &path[baselen];
*endp++ = '/';

View File

@ -1,4 +1,4 @@
/* $NetBSD: badsect.c,v 1.22 2003/04/02 10:39:22 fvdl Exp $ */
/* $NetBSD: badsect.c,v 1.23 2003/07/13 08:23:39 itojun Exp $ */
/*
* Copyright (c) 1981, 1983, 1993
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1981, 1983, 1993\n\
#if 0
static char sccsid[] = "@(#)badsect.c 8.2 (Berkeley) 5/4/95";
#else
__RCSID("$NetBSD: badsect.c,v 1.22 2003/04/02 10:39:22 fvdl Exp $");
__RCSID("$NetBSD: badsect.c,v 1.23 2003/07/13 08:23:39 itojun Exp $");
#endif
#endif /* not lint */
@ -122,7 +122,7 @@ main(argc, argv)
if (stat(".", &stbuf) == -1)
err(1, "Cannot stat `%s'", argv[1]);
(void) strcpy(name, _PATH_DEV);
(void) strlcpy(name, _PATH_DEV, sizeof(name));
if ((dirp = opendir(name)) == NULL)
err(1, "Cannot opendir `%s'", argv[1]);