summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr.bin/sed/process.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c
index aa44378..7efdeed 100644
--- a/usr.bin/sed/process.c
+++ b/usr.bin/sed/process.c
@@ -470,7 +470,7 @@ lputs(s)
static int termwidth = -1;
if (termwidth == -1) {
- if ((p = getenv("COLUMNS")))
+ if ((p = getenv("COLUMNS")) && *p != '\0')
termwidth = atoi(p);
else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 &&
win.ws_col > 0)
OpenPOWER on IntegriCloud