X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/f73f1009084e75624e3bc00fef9cf4749de80dcc..4842cad26009ebcd3c2e39d529d0f4908599a7b5:/larn/scores.c?ds=inline diff --git a/larn/scores.c b/larn/scores.c index 2fbe635e..e9082a95 100644 --- a/larn/scores.c +++ b/larn/scores.c @@ -1,4 +1,4 @@ -/* $NetBSD: scores.c,v 1.10 1997/10/18 20:03:48 christos Exp $ */ +/* $NetBSD: scores.c,v 1.11 2001/02/05 00:57:34 christos Exp $ */ /* * scores.c Larn is copyrighted 1986 by Noah Morgan. @@ -26,7 +26,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: scores.c,v 1.10 1997/10/18 20:03:48 christos Exp $"); +__RCSID("$NetBSD: scores.c,v 1.11 2001/02/05 00:57:34 christos Exp $"); #endif /* not lint */ #include #include @@ -668,9 +668,11 @@ invalid: mod = "an"; else mod = "a"; - sprintf(logg.what, "killed by %s %s", mod, monster[x].name); + snprintf(logg.what, sizeof(logg.what), + "killed by %s %s", mod, monster[x].name); } else - sprintf(logg.what, "%s", whydead[x - 256]); + snprintf(logg.what, sizeof(logg.what), + "%s", whydead[x - 256]); logg.cavelev = level; time(&zzz); /* get cpu time -- write out score info */ logg.diedtime = zzz; @@ -797,7 +799,7 @@ getplid(nam) if (havepid != -1) return (havepid); /* already did it */ lflush(); /* flush any pending I/O */ - sprintf(name, "%s\n", nam); /* append a \n to name */ + snprintf(name, sizeof(name), "%s\n", nam);/* append a \n to name */ if (lopen(playerids) < 0) { /* no file, make it */ if ((fd7 = creat(playerids, 0666)) < 0) return (-1); /* can't make it */