Skip to content

Commit 7a56e9b

Browse files
committed
fix segfault on some implementations of atoi
1 parent 1cbc914 commit 7a56e9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

phpdbg_prompt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static PHPDBG_COMMAND(compile) /* {{{ */
257257

258258
static PHPDBG_COMMAND(step) /* {{{ */
259259
{
260-
if (atoi(expr)) {
260+
if (expr && atoi(expr)) {
261261
PHPDBG_G(flags) |= PHPDBG_IS_STEPPING;
262262
} else {
263263
PHPDBG_G(flags) &= ~PHPDBG_IS_STEPPING;
@@ -636,7 +636,7 @@ static PHPDBG_COMMAND(help) /* {{{ */
636636
} /* }}} */
637637

638638
static PHPDBG_COMMAND(quiet) { /* {{{ */
639-
if (atoi(expr)) {
639+
if (expr && atoi(expr)) {
640640
PHPDBG_G(flags) |= PHPDBG_IS_QUIET;
641641
} else {
642642
PHPDBG_G(flags) &= ~PHPDBG_IS_QUIET;

0 commit comments

Comments
 (0)