From d23589482994f9ec7e17f81415324eea6e26d015 Mon Sep 17 00:00:00 2001 From: Gary Mills Date: Wed, 17 Oct 2012 06:40:09 -0700 Subject: [PATCH] 702 tput calls gets() Reviewed by: Dan McDonald Reviewed by: Gordon Ross Approved by: Garrett D'Amore --- usr/src/cmd/tput/tput.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr/src/cmd/tput/tput.c b/usr/src/cmd/tput/tput.c index 18dce8d6cb..c8a61cc2ee 100644 --- a/usr/src/cmd/tput/tput.c +++ b/usr/src/cmd/tput/tput.c @@ -22,6 +22,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2012 Gary Mills */ /* Copyright (c) 1988 AT&T */ @@ -174,10 +175,12 @@ main(int argc, char **argv) for (i = 0; i < 10; i++) v[i] = (char *)malloc(32 * sizeof (char)); - while (gets(buff) != NULL) { + while (fgets(buff, sizeof (buff), stdin) != NULL) { /* read standard input line; skip over empty lines */ if ((std_argc = - sscanf(buff, "%s %s %s %s %s %s %s %s %s %s", + sscanf(buff, + "%31s %31s %31s %31s %31s %31s %31s %31s " + "%31s %31s", v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8], v[9])) < 1) { continue; -- 2.11.4.GIT