]> granicus.if.org Git - php/commitdiff
MFH
authorAntony Dovgal <tony2001@php.net>
Sat, 10 Feb 2007 00:50:38 +0000 (00:50 +0000)
committerAntony Dovgal <tony2001@php.net>
Sat, 10 Feb 2007 00:50:38 +0000 (00:50 +0000)
ext/posix/posix.c
ext/standard/string.c

index baf72cbf293e0705f8d95fa3fa42cb3e85ccd12a..0c377842643993b5e3b87e6079cf54832665b8d8 100644 (file)
@@ -872,7 +872,7 @@ PHP_FUNCTION(posix_getgrnam)
 PHP_FUNCTION(posix_getgrgid)
 {
        long gid;
-#ifdef HAVE_GETGRGID_R
+#if defined(ZTS) && defined(HAVE_GETGRGID_R) && defined(_SC_GETGR_R_SIZE_MAX)
        int ret;
        struct group _g;
        struct group *retgrptr;
index 70d26264e8531b131fc7f23e826b36b331a2cac2..aec6624b65c5d77efcc6c96243a2463b59ed0ac5 100644 (file)
@@ -3148,7 +3148,7 @@ PHPAPI int php_char_to_str_ex(char *str, uint len, char from, char *to, int to_l
        }
        
        Z_STRLEN_P(result) = len + (char_count * (to_len - 1));
-       Z_STRVAL_P(result) = target = safe_emalloc(char_count, to_len, len);
+       Z_STRVAL_P(result) = target = safe_emalloc(char_count, to_len, len + 1);
        Z_TYPE_P(result) = IS_STRING;
 
        if (case_sensitivity) {