# HG changeset patch # User Garrett D'Amore # Date 1297990010 28800 # Node ID fe7962c08d1df7bdec479290d27be20899d6dd5e # Parent d5c7e34a4e3f2f9db341416d9dd53f352b9aa515 Backed out changeset 0a79ebc0f4b3 - needs more work. diff -r d5c7e34a4e3f -r fe7962c08d1d usr/src/cmd/spell/hashmake.c --- a/usr/src/cmd/spell/hashmake.c Thu Feb 17 16:07:03 2011 -0800 +++ b/usr/src/cmd/spell/hashmake.c Thu Feb 17 16:46:50 2011 -0800 @@ -26,7 +26,8 @@ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ -/* Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ + +#pragma ident "%Z%%M% %I% %E% SMI" #include #include @@ -50,7 +51,7 @@ (void) textdomain(TEXT_DOMAIN); hashinit(); - while (fgets(word, sizeof (word), stdin)) { + while (gets(word)) { (void) printf("%.*lo\n", (HASHWIDTH+2)/3, hash(word)); } return (0); diff -r d5c7e34a4e3f -r fe7962c08d1d usr/src/cmd/tput/tput.c --- a/usr/src/cmd/tput/tput.c Thu Feb 17 16:07:03 2011 -0800 +++ b/usr/src/cmd/tput/tput.c Thu Feb 17 16:46:50 2011 -0800 @@ -23,7 +23,6 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -/* Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ /* Copyright (c) 1988 AT&T */ /* All Rights Reserved */ @@ -59,7 +58,6 @@ #include #include #include -#include /* externs from libcurses */ extern int tigetnum(); @@ -168,23 +166,15 @@ exit(outputcap(cap, argc, argv)); return (0); } else { /* standard input argumets */ - char buff[256]; + char buff[128]; char **v; - /* - * allocate storage for the 'faked' argv[] array - * - * fixme: The algorithm here is botched. Who or what defines - * that only 10 arguments with 32 bytes each are passed? - */ + /* allocate storage for the 'faked' argv[] array */ v = (char **)malloc(10 * sizeof (char *)); - for (i = 0; i < 10; i++) { - v[i] = (char *)malloc(32); - if (!v[i]) - err(EXIT_FAILURE, "no memory for argv[] array"); - } + for (i = 0; i < 10; i++) + v[i] = (char *)malloc(32 * sizeof (char)); - while (fgets(buff, sizeof (buff), stdin) != NULL) { + while (gets(buff) != NULL) { /* read standard input line; skip over empty lines */ if ((std_argc = sscanf(buff, "%s %s %s %s %s %s %s %s %s %s",