From: millert Date: Sun, 15 Sep 1996 21:56:11 +0000 (+0000) Subject: sprintf -> snprintf paranoia X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3f33d8cd97e5b9fc0dbcab2a1879842de9f0b6d0;p=openbsd sprintf -> snprintf paranoia --- diff --git a/bin/chio/chio.c b/bin/chio/chio.c index a808f9a7a14..c5734570c23 100644 --- a/bin/chio/chio.c +++ b/bin/chio/chio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chio.c,v 1.2 1996/06/23 14:19:04 deraadt Exp $ */ +/* $OpenBSD: chio.c,v 1.3 1996/09/15 21:56:11 millert Exp $ */ /* $NetBSD: chio.c,v 1.1.1.1 1996/04/03 00:34:38 thorpej Exp $ */ /* @@ -638,7 +638,8 @@ bits_to_string(v, cp) np++; if ((v & (1 << (f - 1))) == 0) continue; - bp += sprintf(bp, "%c%.*s", sep, np - cp, cp); + bp += snprintf(bp, sizeof(buf) - (bp - &buf[0]), + "%c%.*s", sep, np - cp, cp); sep = ','; } if (sep != '<')