]> granicus.if.org Git - php/commitdiff
Fix incorrect TSRMLS_CC usage.
authorWez Furlong <wez@php.net>
Tue, 18 Feb 2003 19:03:44 +0000 (19:03 +0000)
committerWez Furlong <wez@php.net>
Tue, 18 Feb 2003 19:03:44 +0000 (19:03 +0000)
Fix com_create_guid()

ext/rpc/com/com.c
main/streams/streams.c

index 9a8e40587b450675b23c74e617c2904c8f490f80..7e5339291773a94f7e118189f7bcb54ef9b6afd6 100644 (file)
@@ -841,7 +841,7 @@ static ZEND_FUNCTION(com_create_guid)
                ZEND_WRONG_PARAM_COUNT();
        }
 
-       if (CoCreateGuid(&retval) && StringFromCLSID(&retval, &guid_string)) {
+       if (CoCreateGuid(&retval) == S_OK && StringFromCLSID(&retval, &guid_string) == S_OK) {
                Z_TYPE_P(return_value) = IS_STRING;
                Z_STRVAL_P(return_value) = php_OLECHAR_to_char(guid_string, &Z_STRLEN_P(return_value), CP_ACP, 0);
 
index bb72a4f801c87a23e8b50ba1b409f8285ec32479..d2ef95dda8e0a0e4f6daa78585c0e42a0ca316d0 100755 (executable)
@@ -1198,6 +1198,7 @@ PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size
        size_t readchunk;
        size_t haveread = 0;
        size_t didread;
+       php_stream_statbuf ssbuf;
 #if HAVE_MMAP
        int srcfd;
 #endif
@@ -1243,14 +1244,11 @@ PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size
        }
 #endif
 
-       {
-               php_stream_statbuf sbuf;
-               if (php_stream_stat(src, &sbuf TSRMLS_CC) == 0) {
-                       /* in the event that the source file is 0 bytes, return 1 to indicate success
-                        * because opening the file to write had already created a copy */
-                       if (sbuf.sb.st_size == 0) {
-                               return 1;
-                       }
+       if (php_stream_stat(src, &ssbuf) == 0) {
+               /* in the event that the source file is 0 bytes, return 1 to indicate success
+                * because opening the file to write had already created a copy */
+               if (ssbuf.sb.st_size == 0) {
+                       return 1;
                }
        }