X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;ds=sidebyside;f=ncurses%2Ftinfo%2Flib_setup.c;h=a6527bfd096774b3f5b26f4a3267d6ce0c6e468b;hb=460005b642d978c6d4b48810803514bd36a6245b;hp=b1d1e1ae8213adb17ac19e9f8cfee22054d61e23;hpb=d76c9bfec68e0efa6e1b8e95b32b66caf25cfc12;p=ncurses.git diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index b1d1e1ae..a6527bfd 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. * + * Copyright 2018-2019,2020 Thomas E. Dickey * + * Copyright 1998-2016,2017 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -48,7 +49,7 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.204 2019/08/10 17:08:00 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.207 2020/02/02 23:34:34 tom Exp $") /**************************************************************************** * @@ -173,16 +174,20 @@ NCURSES_EXPORT(int) NCURSES_SP_NAME(set_tabsize) (NCURSES_SP_DCLx int value) { int code = OK; -#if USE_REENTRANT - if (SP_PARM) { - SP_PARM->_TABSIZE = value; - } else { + if (value <= 0) { code = ERR; - } + } else { +#if USE_REENTRANT + if (SP_PARM) { + SP_PARM->_TABSIZE = value; + } else { + code = ERR; + } #else - (void) SP_PARM; - TABSIZE = value; + (void) SP_PARM; + TABSIZE = value; #endif + } return code; }