summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r--ext/standard/string.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index cd2dd7b8c9..27b32b36e9 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -5531,7 +5531,15 @@ PHP_FUNCTION(money_format)
zend_string_free(str);
RETURN_FALSE;
}
+#ifdef _AIX
+ /*
+ On AIX strfmon seems to include the terminating \0 in the length returned by strfmon,
+ despite the documentation indicating it is not included.
+ */
+ ZSTR_LEN(str) = strlen(ZSTR_VAL(str));
+#else
ZSTR_LEN(str) = (size_t)res_len;
+#endif
ZSTR_VAL(str)[ZSTR_LEN(str)] = '\0';
RETURN_NEW_STR(zend_string_truncate(str, ZSTR_LEN(str), 0));