Skip to content
Browse files

Merge pull request #120 from vincentbernat/fix/compression-bigendian

Fix compression on big-endian architecture
  • Loading branch information...
2 parents 03d2244 + 98e7e6b commit 304806f5cc95c54e681b80466e5eb980db2b9861 @mkoppanen committed Jan 9, 2014
Showing with 2 additions and 1 deletion.
  1. +2 −1 php_memcached.c
View
3 php_memcached.c
@@ -3084,9 +3084,10 @@ char *s_compress_value (enum memcached_compression_type compression_type, const
/* Store compressed size here */
size_t compressed_size = 0;
+ uint32_t plen = *payload_len;
/* Copy the uin32_t at the beginning */
- memcpy(buffer, payload_len, sizeof(uint32_t));
+ memcpy(buffer, &plen, sizeof(uint32_t));
buffer += sizeof(uint32_t);
switch (compression_type) {

0 comments on commit 304806f

Please sign in to comment.
Something went wrong with that request. Please try again.