summaryrefslogtreecommitdiffstats
path: root/libexec/telnetd/utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'libexec/telnetd/utility.c')
-rw-r--r--libexec/telnetd/utility.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/telnetd/utility.c b/libexec/telnetd/utility.c
index ee69173..97478a7 100644
--- a/libexec/telnetd/utility.c
+++ b/libexec/telnetd/utility.c
@@ -330,7 +330,7 @@ fatal(f, msg)
{
char buf[BUFSIZ];
- (void) sprintf(buf, "telnetd: %s.\r\n", msg);
+ (void) snprintf(buf, sizeof(buf), "telnetd: %s.\r\n", msg);
(void) write(f, buf, (int)strlen(buf));
sleep(1); /*XXX*/
exit(1);
@@ -343,7 +343,7 @@ fatalperror(f, msg)
{
char buf[BUFSIZ], *strerror();
- (void) sprintf(buf, "%s: %s", msg, strerror(errno));
+ (void) snprintf(buf, sizeof(buf), "%s: %s", msg, strerror(errno));
fatal(f, buf);
}
OpenPOWER on IntegriCloud