Skip to content

Commit bf6eb65

Browse files
committed
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fixed bug #72979 money_format stores wrong length on AIX
2 parents 0738a78 + 8dd523a commit bf6eb65

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ PHP NEWS
2525
. Fixed bug #47021 (SoapClient stumbles over WSDL delivered with
2626
"Transfer-Encoding: chunked"). (Rowan Collins)
2727
. Fixed bug #72974 (imap is undefined service on AIX). (matthieu.sarter)
28+
. Fixed bug #72979 (money_format stores wrong length AIX). (matthieu.sarter)
2829

2930
- ZIP:
3031
. Fixed bug #70103 (ZipArchive::addGlob ignores remove_all_path option). (cmb,

ext/standard/string.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5531,7 +5531,15 @@ PHP_FUNCTION(money_format)
55315531
zend_string_free(str);
55325532
RETURN_FALSE;
55335533
}
5534+
#ifdef _AIX
5535+
/*
5536+
On AIX strfmon seems to include the terminating \0 in the length returned by strfmon,
5537+
despite the documentation indicating it is not included.
5538+
*/
5539+
ZSTR_LEN(str) = strlen(ZSTR_VAL(str));
5540+
#else
55345541
ZSTR_LEN(str) = (size_t)res_len;
5542+
#endif
55355543
ZSTR_VAL(str)[ZSTR_LEN(str)] = '\0';
55365544

55375545
RETURN_NEW_STR(zend_string_truncate(str, ZSTR_LEN(str), 0));

0 commit comments

Comments
 (0)