From 6cc626ca663340efc734eaf0822b2948251aae43 Mon Sep 17 00:00:00 2001 From: mrg Date: Sun, 3 Feb 2019 10:48:46 +0000 Subject: [PATCH] - enlarge buffer to avoid snprintf() truncation --- cribbage/score.c | 6 +++--- hack/hack.unix.c | 6 +++--- sail/dr_2.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cribbage/score.c b/cribbage/score.c index a2af9eb7..56c023c8 100644 --- a/cribbage/score.c +++ b/cribbage/score.c @@ -1,4 +1,4 @@ -/* $NetBSD: score.c,v 1.16 2012/10/13 20:36:06 dholland Exp $ */ +/* $NetBSD: score.c,v 1.17 2019/02/03 10:48:46 mrg Exp $ */ /*- * Copyright (c) 1980, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: score.c,v 1.16 2012/10/13 20:36:06 dholland Exp $"); +__RCSID("$NetBSD: score.c,v 1.17 2019/02/03 10:48:46 mrg Exp $"); #endif #endif /* not lint */ @@ -115,7 +115,7 @@ scorehand(const CARD hand[], CARD starter, int n, BOOLEAN crb, int hscore; BOOLEAN flag; CARD h[(CINHAND + 1)]; - char buf[32]; + char buf[52]; explan[0] = '\0'; /* initialize explanation */ hscore = 0; diff --git a/hack/hack.unix.c b/hack/hack.unix.c index dd4c6799..811aedc1 100644 --- a/hack/hack.unix.c +++ b/hack/hack.unix.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.unix.c,v 1.17 2011/09/01 07:18:50 plunky Exp $ */ +/* $NetBSD: hack.unix.c,v 1.18 2019/02/03 10:48:46 mrg Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include #ifndef lint -__RCSID("$NetBSD: hack.unix.c,v 1.17 2011/09/01 07:18:50 plunky Exp $"); +__RCSID("$NetBSD: hack.unix.c,v 1.18 2019/02/03 10:48:46 mrg Exp $"); #endif /* not lint */ /* This file collects some Unix dependencies; hack.pager.c contains some more */ @@ -123,7 +123,7 @@ getyear(void) char * getdatestr(void) { - static char datestr[7]; + static char datestr[32]; struct tm *lt = getlt(); (void) snprintf(datestr, sizeof(datestr), "%02d%02d%02d", diff --git a/sail/dr_2.c b/sail/dr_2.c index ce4c75c8..40a24839 100644 --- a/sail/dr_2.c +++ b/sail/dr_2.c @@ -1,4 +1,4 @@ -/* $NetBSD: dr_2.c,v 1.26 2014/03/28 17:53:47 apb Exp $ */ +/* $NetBSD: dr_2.c,v 1.27 2019/02/03 10:48:46 mrg Exp $ */ /* * Copyright (c) 1983, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)dr_2.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: dr_2.c,v 1.26 2014/03/28 17:53:47 apb Exp $"); +__RCSID("$NetBSD: dr_2.c,v 1.27 2019/02/03 10:48:46 mrg Exp $"); #endif #endif /* not lint */ @@ -252,7 +252,7 @@ try(struct ship *f, struct ship *t, int ma, int ta, bool af, int vma, int dir, int *high, int rakeme) { int new, n; - char st[4]; + char st[11]; #define rakeyou (gunsbear(f, t) && !gunsbear(t, f)) if ((n = str_end(temp)) < '1' || n > '9') -- 2.47.1