com php-src: Fix accidental short-circuiting when comparing fds (& warnings): phpdbg.c phpdbg_set.c

From: Date: Tue, 23 Sep 2014 16:29:36 +0000
Subject: com php-src: Fix accidental short-circuiting when comparing fds (& warnings): phpdbg.c phpdbg_set.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-82625@lists.php.net to get a copy of this message
Commit: 3b81337f80419b1736224461edc2266852a37fcc Author: Bob Weinand <bobwei9@hotmail.com> Tue, 23 Sep 2014 18:29:36 +0200 Parents: 79ea51f360b1ec80ef12332a29aa365a856fcfb0 Branches: PHP-5.6 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3b81337f80419b1736224461edc2266852a37fcc Log: Fix accidental short-circuiting when comparing fds (& warnings) Changed paths: M phpdbg.c M phpdbg_set.c Diff: diff --git a/phpdbg.c b/phpdbg.c index ab2f825..0c4e2f1 100644 --- a/phpdbg.c +++ b/phpdbg.c @@ -534,7 +534,7 @@ static size_t phpdbg_stdiop_write(php_stream *stream, const char *buf, size_t co while (data->fd >= 0) { struct stat stat[3]; memset(stat, 0, sizeof(stat)); - if ((fstat(fileno(stderr), &stat[2]) < 0 && fstat(fileno(stdout), &stat[0]) < 0) || fstat(data->fd, &stat[1]) < 0) { + if (((fstat(fileno(stderr), &stat[2]) < 0) & (fstat(fileno(stdout), &stat[0]) < 0)) | (fstat(data->fd, &stat[1]) < 0)) { break; } diff --git a/phpdbg_set.c b/phpdbg_set.c index e5d8d6d..da85071 100644 --- a/phpdbg_set.c +++ b/phpdbg_set.c @@ -69,9 +69,9 @@ PHPDBG_SET(break) /* {{{ */ } else { phpdbg_breakbase_t *brake = phpdbg_find_breakbase(param->num TSRMLS_CC); if (brake) { - phpdbg_writeln("setbreak", "id=\"%d\" active=\"%s\"", "Breakpoint #%d %s", param->num, brake->disabled ? "off" : "on"); + phpdbg_writeln("setbreak", "id=\"%ld\" active=\"%s\"", "Breakpoint #%ld %s", param->num, brake->disabled ? "off" : "on"); } else { - phpdbg_error("setbreak", "type=\"nobreak\" id=\"%d\"", "Failed to find breakpoint #%ld", param->num); + phpdbg_error("setbreak", "type=\"nobreak\" id=\"%ld\"", "Failed to find breakpoint #%ld", param->num); } } } break;

« previous php.cvs (#82625) next »