version 1.1.1.1, 2012/05/29 12:26:49
|
version 1.1.1.3, 2014/06/15 16:12:54
|
Line 1
|
Line 1
|
/* |
/* |
* Copyright (c) 2010 Todd C. Miller <Todd.Miller@courtesan.com> | * Copyright (c) 2010-2012 Todd C. Miller <Todd.Miller@courtesan.com> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
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; |