Browse Source

MFH: fix parameter parsing in getrusage()

experimental/5.2-WITH_DRCP
Hannes Magnusson 20 years ago
parent
commit
b11b08e987
  1. 8
      README.UPDATE_5_2
  2. 6
      ext/standard/microtime.c

8
README.UPDATE_5_2

@ -173,6 +173,14 @@ Items from the NEWS file explained
you to fine-grain the levels of the messages stored.
==============================
Backwards incompatible changes
==============================
In the PHP core
===============
getrusage() will return NULL when passed incompatible arguments
==================
NEW ERROR MESSAGES
==================

6
ext/standard/microtime.c

@ -115,7 +115,11 @@ PHP_FUNCTION(getrusage)
long pwho = 0;
int who = RUSAGE_SELF;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) != FAILURE && pwho == 1) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &pwho) == FAILURE) {
return;
}
if (pwho == 1) {
who = RUSAGE_CHILDREN;
}

Loading…
Cancel
Save