X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fcurses.priv.h;h=353a76142df82e87cd6ddd77d915d181094ce814;hp=24a114ad7248fd895f47f3e9e7ae5f8731993997;hb=5f0c3bcf3f059317e85d89631e7ef194c9425304;hpb=78b0123661ebab93d5bd5345b89e6e76d6560ec0 diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 24a114ad..353a7614 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.603 2018/06/30 21:46:25 tom Exp $ + * $Id: curses.priv.h,v 1.606 2018/09/01 20:16:30 tom Exp $ * * curses.priv.h * @@ -71,7 +71,7 @@ extern "C" { #include #endif -#if HAVE_SYS_BSDTYPES_H) && !(defined(_WIN32) || defined(_WIN64)) +#if HAVE_SYS_BSDTYPES_H && !(defined(_WIN32) || defined(_WIN64)) #include /* needed for ISC */ #endif @@ -916,6 +916,8 @@ typedef struct { int slk_format; + int getstr_limit; /* getstr_limit based on POSIX LINE_MAX */ + char *safeprint_buf; size_t safeprint_used; @@ -1003,6 +1005,15 @@ extern NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals; #define N_RIPS 5 +/* The limit reserves one byte for a terminating NUL */ +#define my_getstr_limit (_nc_globals.getstr_limit - 1) +#define _nc_getstr_limit(n) \ + (((n) < 0) \ + ? my_getstr_limit \ + : (((n) > my_getstr_limit) \ + ? my_getstr_limit \ + : (n))) + #ifdef USE_PTHREADS typedef struct _prescreen_list { struct _prescreen_list *next;