From 1d7db01c4179786cb7a1b4d499ca97a5fdedd993 Mon Sep 17 00:00:00 2001 From: Adam Saponara Date: Sun, 4 Jun 2023 13:06:16 -0400 Subject: [PATCH] avoid setting `PATH_MAX` (use `TB_PATH_MAX`) h/t @rofl0r --- termbox2.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/termbox2.h b/termbox2.h index d999151..a065341 100644 --- a/termbox2.h +++ b/termbox2.h @@ -52,8 +52,10 @@ SOFTWARE. #include #include -#ifndef PATH_MAX -#define PATH_MAX 4096 +#ifdef PATH_MAX +#define TB_PATH_MAX PATH_MAX +#else +#define TB_PATH_MAX 4096 #endif #ifdef __cplusplus @@ -2270,7 +2272,7 @@ static int tb_deinit(void) { static int load_terminfo(void) { int rv; - char tmp[PATH_MAX]; + char tmp[TB_PATH_MAX]; // See terminfo(5) "Fetching Compiled Descriptions" for a description of // this behavior. Some of these paths are compile-time ncurses options, so @@ -2330,7 +2332,7 @@ static int load_terminfo(void) { static int load_terminfo_from_path(const char *path, const char *term) { int rv; - char tmp[PATH_MAX]; + char tmp[TB_PATH_MAX]; // Look for term at this terminfo location, e.g., /x/xterm snprintf_or_return(rv, tmp, sizeof(tmp), "%s/%c/%s", path, term[0], term); -- 2.39.5