version 1.1.1.2, 2013/07/22 10:46:11
|
version 1.1.1.3, 2014/06/15 16:12:54
|
Line 33
|
Line 33
|
# include <unistd.h> |
# include <unistd.h> |
#endif /* HAVE_UNISTD_H */ |
#endif /* HAVE_UNISTD_H */ |
#include <termios.h> |
#include <termios.h> |
|
#include <limits.h> |
|
|
#include "missing.h" |
#include "missing.h" |
#include "sudo_debug.h" |
#include "sudo_debug.h" |
|
#include "sudo_util.h" |
|
|
/* Compatibility with older tty systems. */ |
/* Compatibility with older tty systems. */ |
#if !defined(TIOCGWINSZ) && defined(TIOCGSIZE) |
#if !defined(TIOCGWINSZ) && defined(TIOCGSIZE) |
Line 77 get_ttysize(int *rowp, int *colp)
|
Line 79 get_ttysize(int *rowp, int *colp)
|
char *p; |
char *p; |
|
|
/* Fall back on $LINES and $COLUMNS. */ |
/* Fall back on $LINES and $COLUMNS. */ |
if ((p = getenv("LINES")) == NULL || (*rowp = atoi(p)) <= 0) | if ((p = getenv("LINES")) == NULL || |
| (*rowp = strtonum(p, 1, INT_MAX, NULL)) <= 0) { |
*rowp = 24; |
*rowp = 24; |
if ((p = getenv("COLUMNS")) == NULL || (*colp = atoi(p)) <= 0) | } |
| if ((p = getenv("COLUMNS")) == NULL || |
| (*colp = strtonum(p, 1, INT_MAX, NULL)) <= 0) { |
*colp = 80; |
*colp = 80; |
|
} |
} |
} |
|
|
debug_return; |
debug_return; |