-/* $OpenBSD: main.c,v 1.10 1996/09/14 19:28:58 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.11 1996/12/16 17:11:32 deraadt Exp $ */
/* $NetBSD: main.c,v 1.8 1996/03/15 22:39:32 scottr Exp $ */
/*-
if (dp == NULL)
return (NULL);
*dp = '\0';
- (void)strncpy(rawbuf, cp, MAXPATHLEN);
+ (void)strncpy(rawbuf, cp, MAXPATHLEN-1);
+ rawbuf[MAXPATHLEN-1] = '\0';
*dp = '/';
- (void)strncat(rawbuf, "/r", MAXPATHLEN - 1 - strlen(rawbuf));
- (void)strncat(rawbuf, dp + 1, MAXPATHLEN - 1 - strlen(rawbuf));
+ (void)strncat(rawbuf, "/r", MAXPATHLEN - strlen(rawbuf));
+ (void)strncat(rawbuf, dp + 1, MAXPATHLEN - strlen(rawbuf));
return (rawbuf);
}
-/* $OpenBSD: mount_ados.c,v 1.3 1996/06/23 14:31:14 deraadt Exp $ */
+/* $OpenBSD: mount_ados.c,v 1.4 1996/12/16 17:11:36 deraadt Exp $ */
/* $NetBSD: mount_ados.c,v 1.5 1996/04/13 01:30:59 jtc Exp $ */
/*
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: mount_ados.c,v 1.3 1996/06/23 14:31:14 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: mount_ados.c,v 1.4 1996/12/16 17:11:36 deraadt Exp $";
#endif /* not lint */
#include <sys/cdefs.h>
warnx("\"%s\" is a relative path.", dir);
if (getcwd(ndir, sizeof(ndir)) == NULL)
err(1, "getcwd");
- strncat(ndir, "/", sizeof(ndir) - strlen(ndir) - 1);
- strncat(ndir, dir, sizeof(ndir) - strlen(ndir) - 1);
+ strncat(ndir, "/", sizeof(ndir) - strlen(ndir));
+ strncat(ndir, dir, sizeof(ndir) - strlen(ndir));
dir = ndir;
warnx("using \"%s\" instead.", dir);
}
-/* $OpenBSD: mount_msdos.c,v 1.7 1996/12/09 13:40:55 deraadt Exp $ */
+/* $OpenBSD: mount_msdos.c,v 1.8 1996/12/16 17:11:38 deraadt Exp $ */
/* $NetBSD: mount_msdos.c,v 1.16 1996/10/24 00:12:50 cgd Exp $ */
/*
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: mount_msdos.c,v 1.7 1996/12/09 13:40:55 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: mount_msdos.c,v 1.8 1996/12/16 17:11:38 deraadt Exp $";
#endif /* not lint */
#include <sys/cdefs.h>
warnx("\"%s\" is a relative path.", dir);
if (getcwd(ndir, sizeof(ndir)) == NULL)
err(1, "getcwd");
- strncat(ndir, "/", sizeof(ndir) - strlen(ndir) - 1);
- strncat(ndir, dir, sizeof(ndir) - strlen(ndir) - 1);
+ strncat(ndir, "/", sizeof(ndir) - strlen(ndir));
+ strncat(ndir, dir, sizeof(ndir) - strlen(ndir));
dir = ndir;
warnx("using \"%s\" instead.", dir);
}
-/* $OpenBSD: dirs.c,v 1.10 1996/12/15 18:49:24 millert Exp $ */
+/* $OpenBSD: dirs.c,v 1.11 1996/12/16 17:11:41 deraadt Exp $ */
/* $NetBSD: dirs.c,v 1.16 1995/06/19 00:20:11 cgd Exp $ */
/*
#if 0
static char sccsid[] = "@(#)dirs.c 8.5 (Berkeley) 8/31/94";
#else
-static char rcsid[] = "$OpenBSD: dirs.c,v 1.10 1996/12/15 18:49:24 millert Exp $";
+static char rcsid[] = "$OpenBSD: dirs.c,v 1.11 1996/12/16 17:11:41 deraadt Exp $";
#endif
#endif /* not lint */
*/
(void) strncpy(locname, pname, sizeof(locname) - 1);
locname[sizeof(locname) - 1] = '\0';
- (void) strncat(locname, "/", sizeof(locname) - strlen(locname) - 1);
+ (void) strncat(locname, "/", sizeof(locname) - strlen(locname));
namelen = strlen(locname);
rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt);
dp = rst_readdir(dirp); /* "." */
-/* $OpenBSD: interactive.c,v 1.2 1996/06/23 14:32:15 deraadt Exp $ */
+/* $OpenBSD: interactive.c,v 1.3 1996/12/16 17:11:43 deraadt Exp $ */
/* $NetBSD: interactive.c,v 1.9 1995/03/18 14:59:44 cgd Exp $ */
/*
#if 0
static char sccsid[] = "@(#)interactive.c 8.3 (Berkeley) 9/13/94";
#else
-static char rcsid[] = "$OpenBSD: interactive.c,v 1.2 1996/06/23 14:32:15 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: interactive.c,v 1.3 1996/12/16 17:11:43 deraadt Exp $";
#endif
#endif /* not lint */
entries = 0;
listp = list;
(void) strncpy(locname, name, MAXPATHLEN);
- (void) strncat(locname, "/", MAXPATHLEN);
+ locname[sizeof locname - 1] = '\0';
+ (void) strncat(locname, "/", MAXPATHLEN - strlen(locname));
namelen = strlen(locname);
while (dp = rst_readdir(dirp)) {
if (dp == NULL)