rename info tests
[m6w6/ext-http] / php_http_encoding.c
index 3c5393bcbd7c945cc576ea38a41c6c91404ce80f..b7050f6d769e737984bcddee1fd45996c0c3d179 100644 (file)
@@ -6,7 +6,7 @@
     | modification, are permitted provided that the conditions mentioned |
     | in the accompanying LICENSE file are met.                          |
     +--------------------------------------------------------------------+
-    | Copyright (c) 2004-2013, Michael Wallner <mike@php.net>            |
+    | Copyright (c) 2004-2014, Michael Wallner <mike@php.net>            |
     +--------------------------------------------------------------------+
 */
 
@@ -53,7 +53,6 @@ const char *php_http_encoding_dechunk(const char *encoded, size_t encoded_len, c
                                php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Data does not seem to be chunked encoded");
                                memcpy(*decoded, encoded, encoded_len);
                                *decoded_len = encoded_len;
-                               decoded[*decoded_len] = '\0';
                                return encoded + encoded_len;
                        } else {
                                efree(*decoded);
@@ -181,7 +180,7 @@ STATUS php_http_encoding_deflate(int flags, const char *data, size_t data_len, c
                        (*encoded)[*encoded_len = Z.total_out] = '\0';
                        return SUCCESS;
                } else {
-                       STR_SET(*encoded, NULL);
+                       PTR_SET(*encoded, NULL);
                        *encoded_len = 0;
                }
        }
@@ -514,7 +513,7 @@ static STATUS deflate_update(php_http_encoding_stream_t *s, const char *data, si
                        return SUCCESS;
        }
        
-       STR_SET(*encoded, NULL);
+       PTR_SET(*encoded, NULL);
        *encoded_len = 0;
        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to update deflate stream: %s", zError(status));
        return FAILURE;
@@ -710,7 +709,7 @@ static STATUS deflate_flush(php_http_encoding_stream_t *s, char **encoded, size_
                        return SUCCESS;
        }
        
-       STR_SET(*encoded, NULL);
+       PTR_SET(*encoded, NULL);
        *encoded_len = 0;
        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to flush deflate stream: %s", zError(status));
        return FAILURE;
@@ -767,7 +766,7 @@ static STATUS deflate_finish(php_http_encoding_stream_t *s, char **encoded, size
                return SUCCESS;
        }
        
-       STR_SET(*encoded, NULL);
+       PTR_SET(*encoded, NULL);
        *encoded_len = 0;
        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to finish deflate stream: %s", zError(status));
        return FAILURE;
@@ -806,7 +805,7 @@ static STATUS inflate_finish(php_http_encoding_stream_t *s, char **decoded, size
                return SUCCESS;
        }
        
-       STR_SET(*decoded, NULL);
+       PTR_SET(*decoded, NULL);
        *decoded_len = 0;
        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to finish inflate stream: %s", zError(status));
        return FAILURE;
@@ -1072,7 +1071,7 @@ static PHP_METHOD(HttpEncodingStream, finish)
                                                RETURN_EMPTY_STRING();
                                        }
                                } else {
-                                       STR_FREE(encoded_str);
+                                       PTR_FREE(encoded_str);
                                }
                        }
                }