=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sed/process.c,v retrieving revision 1.22 retrieving revision 1.23 diff -c -r1.22 -r1.23 *** src/usr.bin/sed/process.c 2015/04/13 05:11:23 1.22 --- src/usr.bin/sed/process.c 2015/04/18 18:28:37 1.23 *************** *** 1,4 **** ! /* $OpenBSD: process.c,v 1.22 2015/04/13 05:11:23 deraadt Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. --- 1,4 ---- ! /* $OpenBSD: process.c,v 1.23 2015/04/18 18:28:37 deraadt Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. *************** *** 457,468 **** static int termwidth = -1; if (termwidth == -1) { if ((p = getenv("COLUMNS"))) ! termwidth = atoi(p); ! else if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 && win.ws_col > 0) termwidth = win.ws_col; ! else termwidth = 60; } --- 457,470 ---- static int termwidth = -1; if (termwidth == -1) { + termwidth = 0; if ((p = getenv("COLUMNS"))) ! termwidth = strtonum(p, 0, INT_MAX, NULL); ! if (termwidth == 0 && ! ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 && win.ws_col > 0) termwidth = win.ws_col; ! if (termwidth == 0) termwidth = 60; }