Slightly improved fix compared to my insiration

don't munge argv strings -- copy them first. avoids 'w' showing:
    deraadt  p8 zeus.theos.com    8:26AM     3 dd if of bs

Obtained from:	OpenBSD (file rev 1.3) by Theo de Raadt <deraadt@openbsd.org>
This commit is contained in:
Eivind Eklund 1997-10-08 12:10:33 +00:00
parent 480bf84775
commit 4c33974251
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30230

View File

@ -34,7 +34,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id$
* $Id: args.c,v 1.8 1997/02/22 14:02:41 peter Exp $
*/
#ifndef lint
@ -101,6 +101,8 @@ jcl(argv)
in.dbsz = out.dbsz = 512;
while ((oper = *++argv) != NULL) {
if ((oper = strdup(oper)) == NULL)
errx(1, "unable to allocate space for the argument \"%s\"", *argv);
if ((arg = strchr(oper, '=')) == NULL)
errx(1, "unknown operand %s", oper);
*arg++ = '\0';