-/* $NetBSD: io.c,v 1.21 2007/12/15 19:44:39 perry Exp $ */
+/* $NetBSD: io.c,v 1.22 2009/06/04 04:48:04 dholland Exp $ */
/*-
* Copyright (c) 1980, 1993
#if 0
static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: io.c,v 1.21 2007/12/15 19:44:39 perry Exp $");
+__RCSID("$NetBSD: io.c,v 1.22 2009/06/04 04:48:04 dholland Exp $");
#endif
#endif /* not lint */
va_list ap;
va_start(ap, fmt);
- (void)vsprintf(&Msgbuf[Newpos], fmt, ap);
+ (void)vsnprintf(&Msgbuf[Newpos], sizeof(Msgbuf)-Newpos, fmt, ap);
Newpos = strlen(Msgbuf);
va_end(ap);
endmsg();
va_list ap;
va_start(ap, fmt);
- (void)vsprintf(&Msgbuf[Newpos], fmt, ap);
+ (void)vsnprintf(&Msgbuf[Newpos], sizeof(Msgbuf)-Newpos, fmt, ap);
Newpos = strlen(Msgbuf);
va_end(ap);
}
-/* $NetBSD: score.c,v 1.13 2007/12/15 19:44:39 perry Exp $ */
+/* $NetBSD: score.c,v 1.14 2009/06/04 04:48:04 dholland Exp $ */
/*-
* Copyright (c) 1980, 1993
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: score.c,v 1.13 2007/12/15 19:44:39 perry Exp $");
+__RCSID("$NetBSD: score.c,v 1.14 2009/06/04 04:48:04 dholland Exp $");
#endif
#endif /* not lint */
hscore += i;
if (do_explain) {
if (i > 0) {
- (void) sprintf(buf, "%d points in fifteens", i);
+ (void) snprintf(buf, sizeof(buf),
+ "%d points in fifteens", i);
strcat(explan, buf);
} else
strcat(explan, "No fifteens");
hscore += i;
if (do_explain) {
if (i > 0) {
- (void) sprintf(buf, ", %d points in pairs, %d in runs",
+ (void) snprintf(buf, sizeof(buf),
+ ", %d points in pairs, %d in runs",
pairpoints, runpoints);
strcat(explan, buf);
} else
-/* $NetBSD: support.c,v 1.12 2006/03/20 12:32:21 rtr Exp $ */
+/* $NetBSD: support.c,v 1.13 2009/06/04 04:48:04 dholland Exp $ */
/*-
* Copyright (c) 1980, 1993
#if 0
static char sccsid[] = "@(#)support.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: support.c,v 1.12 2006/03/20 12:32:21 rtr Exp $");
+__RCSID("$NetBSD: support.c,v 1.13 2009/06/04 04:48:04 dholland Exp $");
#endif
#endif /* not lint */
BOOLEAN win;
prhand(hand, CINHAND, Playwin, FALSE);
- (void) sprintf(prompt, "Your %s scores ", s);
+ (void) snprintf(prompt, sizeof(prompt), "Your %s scores ", s);
i = scorehand(hand, turnover, CINHAND, strcmp(s, "crib") == 0, explain);
if ((j = number(0, 29, prompt)) == 19)
j = 0;