diff options
author | imp <imp@FreeBSD.org> | 1997-12-24 19:39:57 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 1997-12-24 19:39:57 +0000 |
commit | 37887cee9ae3ceaaf766e309269edfedaac79810 (patch) | |
tree | faeb2f7c1354e40a481418117c595b42b6b0dc41 /libexec/talkd | |
parent | 66fd98fe99539ebe9f52ce19a693ce3da8a6ab34 (diff) | |
download | FreeBSD-src-37887cee9ae3ceaaf766e309269edfedaac79810.zip FreeBSD-src-37887cee9ae3ceaaf766e309269edfedaac79810.tar.gz |
sprintf->snprintf paranoia
Obtained from: OpenBSD (?)
Diffstat (limited to 'libexec/talkd')
-rw-r--r-- | libexec/talkd/print.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libexec/talkd/print.c b/libexec/talkd/print.c index 25c8f3a..a862dbc 100644 --- a/libexec/talkd/print.c +++ b/libexec/talkd/print.c @@ -36,7 +36,7 @@ static char sccsid[] = "@(#)print.c 8.1 (Berkeley) 6/4/93"; #endif static const char rcsid[] = - "$Id$"; + "$Id: print.c,v 1.6 1997/12/02 12:33:17 charnier Exp $"; #endif /* not lint */ /* debug print routines */ @@ -63,7 +63,7 @@ print_request(cp, mp) char tbuf[80], *tp; if (mp->type > NTYPES) { - (void)sprintf(tbuf, "type %d", mp->type); + (void)snprintf(tbuf, sizeof(tbuf), "type %d", mp->type); tp = tbuf; } else tp = types[mp->type]; @@ -79,12 +79,12 @@ print_response(cp, rp) char tbuf[80], *tp, abuf[80], *ap; if (rp->type > NTYPES) { - (void)sprintf(tbuf, "type %d", rp->type); + (void)snprintf(tbuf, sizeof(tbuf), "type %d", rp->type); tp = tbuf; } else tp = types[rp->type]; if (rp->answer > NANSWERS) { - (void)sprintf(abuf, "answer %d", rp->answer); + (void)snprintf(abuf, sizeof(abuf), "answer %d", rp->answer); ap = abuf; } else ap = answers[rp->answer]; |