From 9a33f5bfb221170e823efd3c33ab5d331baf7c74 Mon Sep 17 00:00:00 2001 From: dholland Date: Sun, 7 Jun 2009 20:13:18 +0000 Subject: sprintf -> snprintf, plus some use of strlcpy/strlcat where appropriate XXX: there's still one sprintf left which will take some hacking to expunge. --- hack/hack.topl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hack/hack.topl.c') diff --git a/hack/hack.topl.c b/hack/hack.topl.c index a9550c8f..80962902 100644 --- a/hack/hack.topl.c +++ b/hack/hack.topl.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.topl.c,v 1.9 2009/06/07 18:30:39 dholland Exp $ */ +/* $NetBSD: hack.topl.c,v 1.10 2009/06/07 20:13:18 dholland Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hack.topl.c,v 1.9 2009/06/07 18:30:39 dholland Exp $"); +__RCSID("$NetBSD: hack.topl.c,v 1.10 2009/06/07 20:13:18 dholland Exp $"); #endif /* not lint */ #include @@ -217,9 +217,9 @@ vpline(const char *line, va_list ap) if (!line || !*line) return; if (!strchr(line, '%')) - (void) strcpy(pbuf, line); + (void) strlcpy(pbuf, line, sizeof(pbuf)); else - (void) vsprintf(pbuf, line, ap); + (void) vsnprintf(pbuf, sizeof(pbuf), line, ap); if (flags.toplin == 1 && !strcmp(pbuf, toplines)) return; nscr(); /* %% */ -- cgit v1.2.3