summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'sapi/phpdbg/phpdbg_utils.c')
-rw-r--r--sapi/phpdbg/phpdbg_utils.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sapi/phpdbg/phpdbg_utils.c b/sapi/phpdbg/phpdbg_utils.c
index 548c9e96b1..699f45b76d 100644
--- a/sapi/phpdbg/phpdbg_utils.c
+++ b/sapi/phpdbg/phpdbg_utils.c
@@ -355,8 +355,11 @@ PHPDBG_API int phpdbg_get_terminal_height(void) /* {{{ */
#ifdef _WIN32
CONSOLE_SCREEN_BUFFER_INFO csbi;
- GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
- lines = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
+ if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) {
+ lines = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
+ } else {
+ lines = 40;
+ }
#elif defined(HAVE_SYS_IOCTL_H) && defined(TIOCGWINSZ)
struct winsize w;