Commit: 6c17bd32c92286e23d086bba91ecb2ca1ba72d18
Parent: 02ba1a539ce86a02e19edf4bbb43926ed37b0a02
Author: opask
Date: Fri, 7 Sep 2018 08:30:01 -0600
style: os_dep.c
Diffstat:
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/os_dep.c b/os_dep.c
@@ -63,10 +63,11 @@ unsigned char *escape_path(unsigned char *path)
return result;
}
-static inline int get_e(unsigned char *env)
+static int get_e(const char *env)
{
- unsigned char *v;
- if ((v = cast_uchar getenv(cast_const_char env))) return atoi(cast_const_char v);
+ const char *v;
+ if ((v = getenv(env)))
+ return atoi(v);
return 0;
}
@@ -152,7 +153,7 @@ int get_terminal_size(int fd, int *x, int *y)
#ifdef TIOCGWINSZ
|| !(*x = ws.ws_col)
#endif
- ) && !(*x = get_e(cast_uchar "COLUMNS"))) {
+ ) && !(*x = get_e("COLUMNS"))) {
*x = 80;
#ifdef _UWIN
*x = 79;
@@ -162,7 +163,7 @@ int get_terminal_size(int fd, int *x, int *y)
#ifdef TIOCGWINSZ
|| !(*y = ws.ws_row)
#endif
- ) && !(*y = get_e(cast_uchar "LINES"))) {
+ ) && !(*y = get_e("LINES"))) {
*y = 24;
}
return 0;