Browse Source

fix wrong string length for registry values

PEAR_1_4DEV
Stanislav Malyshev 23 years ago
parent
commit
e8e0c6fb41
  1. 3
      win32/registry.c

3
win32/registry.c

@ -72,7 +72,8 @@ void UpdateIniFromRegistry(char *path TSRMLS_DC)
RegEnumValue(hKey, i, namebuf, &namebuf_len, NULL, &lType, valuebuf, &valuebuf_len);
if ((lType == REG_SZ) || (lType == REG_EXPAND_SZ)) {
zend_alter_ini_entry(namebuf, namebuf_len + 1, valuebuf, valuebuf_len, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
/* valuebuf_len includes trailing 0 */
zend_alter_ini_entry(namebuf, namebuf_len + 1, valuebuf, valuebuf_len?valuebuf_len-1:0, PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE);
}
i++;

Loading…
Cancel
Save