From 7248d68d49dbc457e8246dc734ee29659fc81d77 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Thu, 24 Aug 2000 14:41:12 +0000 Subject: Fix segfault on readline without parameters --- ext/readline/readline.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ext/readline') diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 37900e43ca..f838ba6168 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -99,9 +99,11 @@ PHP_FUNCTION(readline) if (ac < 0 || ac > 1 || zend_get_parameters_ex(ac, &arg) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_string_ex(arg); + if(ac == 1) { + convert_to_string_ex(arg); + } - result = readline((*arg)->value.str.val); + result = readline(ac?(*arg)->value.str.val:NULL); if (! result) { RETURN_FALSE; -- cgit v1.2.1