use bounded string ops

This commit is contained in:
itojun 2003-07-12 14:48:10 +00:00
parent 09401b303a
commit d99433c2b5

View File

@ -1,4 +1,4 @@
/* $NetBSD: pppoectl.c,v 1.12 2003/06/23 11:53:39 agc Exp $ */
/* $NetBSD: pppoectl.c,v 1.13 2003/07/12 14:48:10 itojun Exp $ */
/*
* Copyright (c) 1997 Joerg Wunsch
@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: pppoectl.c,v 1.12 2003/06/23 11:53:39 agc Exp $");
__RCSID("$NetBSD: pppoectl.c,v 1.13 2003/07/12 14:48:10 itojun Exp $");
#endif
@ -526,7 +526,7 @@ proto_name(int proto)
case SPPP_AUTHPROTO_CHAP: return "chap";
case SPPP_AUTHPROTO_NONE: return "none";
}
sprintf(buf, "0x%x", (unsigned)proto);
snprintf(buf, sizeof(buf), "0x%x", (unsigned)proto);
return buf;
}
@ -536,9 +536,9 @@ authflags(int flags)
static char buf[32];
buf[0] = '\0';
if (flags & SPPP_AUTHFLAG_NOCALLOUT)
strcat(buf, " callin");
strlcat(buf, " callin", sizeof(buf));
if (flags & SPPP_AUTHFLAG_NORECHALLENGE)
strcat(buf, " norechallenge");
strlcat(buf, " norechallenge", sizeof(buf));
return buf;
}