summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a761816)
raw | patch | inline | side by side (parent: a761816)
author | Jenny Wong <jyw@google.com> | |
Thu, 6 Aug 2015 17:02:35 +0000 (10:02 -0700) | ||
committer | Jenny Wong <jyw@google.com> | |
Thu, 6 Aug 2015 18:55:52 +0000 (11:55 -0700) |
https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html
gcc will assume sizeof(void) == 1 when doing pointer arithmetic on
void*s, but other compilers may not.
gcc will assume sizeof(void) == 1 when doing pointer arithmetic on
void*s, but other compilers may not.
src/network.c | patch | blob | history |
diff --git a/src/network.c b/src/network.c
index 916900065aff9241a99454ab86cd2bf675655d8f..84e13a90280e1ea9b79513a2c2bc0afcd6bb5439 100644 (file)
--- a/src/network.c
+++ b/src/network.c
warning_has_been_printed = 1;
}
- *ret_buffer += ph_length;
+ *ret_buffer = (void *) (((char *) *ret_buffer) + ph_length);
*ret_buffer_size -= ph_length;
return (0);
(void *) buffer,
sizeof (pkg_type));
memcpy ((void *) &pkg_length,
- (void *) (buffer + sizeof (pkg_type)),
+ (void *) (((char *) buffer) + sizeof (pkg_type)),
sizeof (pkg_length));
pkg_length = ntohs (pkg_length);