From 25d2f2d0f96c42adf6722773737c1eeec0668020 Mon Sep 17 00:00:00 2001 From: xsa Date: Mon, 23 Jan 2006 16:49:48 +0000 Subject: snprintf() -> strlcpy()/strlcat(); OK niallo@. --- usr.bin/cvs/diff3.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'usr.bin/cvs/diff3.c') diff --git a/usr.bin/cvs/diff3.c b/usr.bin/cvs/diff3.c index 76d01acd083..9ba7978fafc 100644 --- a/usr.bin/cvs/diff3.c +++ b/usr.bin/cvs/diff3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diff3.c,v 1.12 2006/01/02 08:11:56 xsa Exp $ */ +/* $OpenBSD: diff3.c,v 1.13 2006/01/23 16:49:48 xsa Exp $ */ /* * Copyright (C) Caldera International Inc. 2001-2002. @@ -72,7 +72,7 @@ static const char copyright[] = #ifndef lint static const char rcsid[] = - "$OpenBSD: diff3.c,v 1.12 2006/01/02 08:11:56 xsa Exp $"; + "$OpenBSD: diff3.c,v 1.13 2006/01/23 16:49:48 xsa Exp $"; #endif /* not lint */ #include "includes.h" @@ -282,8 +282,11 @@ diff3_internal(int argc, char **argv, const char *fmark, const char *rmark) if (argc < 5) return (-1); - snprintf(f1mark, sizeof(f1mark), "<<<<<<< %s", fmark); - snprintf(f3mark, sizeof(f3mark), ">>>>>>> %s", rmark); + strlcpy(f1mark, "<<<<<<< ", sizeof(f1mark)); + strlcat(f1mark, fmark, sizeof(f1mark)); + + strlcpy(f3mark, ">>>>>>> ", sizeof(f3mark)); + strlcat(f3mark, rmark, sizeof(f3mark)); increase(); m = readin(argv[0], &d13); -- cgit v1.2.3-59-g8ed1b