Patch php-7.0.3-aix-strfmon.patch for Strings related Bug #72979
Patch version 2016-08-30 15:59 UTC
Return to Bug #72979 |
Download this patch
Patch Revisions:
Developer: matthieu.sarter.external@atos.net
diff -Nur php-7.0.3.orig/ext/standard/string.c php-7.0.3-aix/ext/standard/string.c
--- php-7.0.3.orig/ext/standard/string.c 2016-02-02 17:32:26 +0100
+++ php-7.0.3-aix/ext/standard/string.c 2016-03-14 14:41:01 +0100
@@ -5602,7 +5602,15 @@
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));
|