/****************************************************************************
- * Copyright (c) 1998-2016,2018 Free Software Foundation, Inc. *
+ * Copyright 2018-2019,2020 Thomas E. Dickey *
+ * Copyright 1998-2015,2016 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 *
#include <curses.priv.h>
-MODULE_ID("$Id: lib_getch.c,v 1.137 2018/06/24 00:06:37 tom Exp $")
+MODULE_ID("$Id: lib_getch.c,v 1.139 2020/02/02 23:34:34 tom Exp $")
#include <fifo_defs.h>
NCURSES_SP_NAME(set_escdelay) (NCURSES_SP_DCLx int value)
{
int code = OK;
-#if USE_REENTRANT
- if (SP_PARM) {
- SET_ESCDELAY(value);
- } else {
+ if (value < 0) {
code = ERR;
- }
+ } else {
+#if USE_REENTRANT
+ if (SP_PARM) {
+ SET_ESCDELAY(value);
+ } else {
+ code = ERR;
+ }
#else
- (void) SP_PARM;
- ESCDELAY = value;
+ (void) SP_PARM;
+ ESCDELAY = value;
#endif
+ }
return code;
}
set_escdelay(int value)
{
int code;
+ if (value < 0) {
+ code = ERR;
+ } else {
#if USE_REENTRANT
- code = NCURSES_SP_NAME(set_escdelay) (CURRENT_SCREEN, value);
+ code = NCURSES_SP_NAME(set_escdelay) (CURRENT_SCREEN, value);
#else
- ESCDELAY = value;
- code = OK;
+ ESCDELAY = value;
+ code = OK;
#endif
+ }
return code;
}
#endif