summaryrefslogtreecommitdiffstats
path: root/bin/stty/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/stty/print.c')
-rw-r--r--bin/stty/print.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/stty/print.c b/bin/stty/print.c
index 339a203..21eb853 100644
--- a/bin/stty/print.c
+++ b/bin/stty/print.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: print.c,v 1.8 1997/02/22 14:05:53 peter Exp $
*/
#ifndef lint
@@ -205,8 +205,10 @@ print(tp, wp, ldisc, fmt)
if (fmt != BSD && cc[p->sub] == p->def)
continue;
#define WD "%-8s"
- (void)sprintf(buf1 + cnt * 8, WD, p->name);
- (void)sprintf(buf2 + cnt * 8, WD, ccval(p, cc[p->sub]));
+ (void)snprintf(buf1 + cnt * 8, sizeof(buf1) - cnt * 8,
+ WD, p->name);
+ (void)snprintf(buf2 + cnt * 8, sizeof(buf2) - cnt * 8,
+ WD, ccval(p, cc[p->sub]));
if (++cnt == LINELENGTH / 8) {
cnt = 0;
(void)printf("%s\n", buf1);
OpenPOWER on IntegriCloud