summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--win32/registry.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/win32/registry.c b/win32/registry.c
index c9a324b628..6eda0f9fff 100644
--- a/win32/registry.c
+++ b/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++;