changeset 13358:f7ba8ec46a21

900 sed errors when -e is given a 0-length argument Reviewed by: Dan McDonald <danmcd@nexenta.com> Reviewed by: Garrett D'Amore <garrett@nexenta.com> Reviewed by: Robert Gordon <rbg@openrbg.com> Reviewed by: Jason King <jason.brian.king@gmail.com> Approved by: Richard Lowe <richlowe@richlowe.net>
author Gary Mills <mills@cc.umanitoba.ca>
date Thu, 28 Apr 2011 12:40:06 -0500
parents af2b8df56c61
children 10bc9c3abe6e
files usr/src/cmd/sed/main.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/cmd/sed/main.c	Wed Apr 20 01:14:34 2011 -0400
+++ b/usr/src/cmd/sed/main.c	Thu Apr 28 12:40:06 2011 -0500
@@ -1,4 +1,5 @@
 /*
+ * Copyright (c) 2011 Gary Mills
  * Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 1992 Diomidis Spinellis.
  * Copyright (c) 1992, 1993
@@ -141,7 +142,7 @@
 			break;
 		case 'e':
 			eflag = 1;
-			if (asprintf(&temp_arg, "%s\n", optarg) <= 1)
+			if (asprintf(&temp_arg, "%s\n", optarg) < 1)
 				err(1, "asprintf");
 			add_compunit(CU_STRING, temp_arg);
 			break;