diff options
author | Max Bires <jbires@google.com> | 2019-03-27 02:15:24 -0700 |
---|---|---|
committer | Max Bires <jbires@google.com> | 2019-03-27 02:15:24 -0700 |
commit | 68f26babcee9c1fa6fc6edaa6ccd8acbe781caab (patch) | |
tree | d018a6acd32a9e3700bbe9d4d6b7b5cca533cf51 | |
parent | 0f79533b608b0cfe28634ef8389931d8b6915e2b (diff) | |
download | cn-cbor-68f26babcee9c1fa6fc6edaa6ccd8acbe781caab.tar.gz |
Fixing the pointer cast for ntoh32p in cn-cbor
This line was incorrectly casting p to a long pointer rather than a 32
bit integer pointer.
Bug: 113512324
Test: it's unused code.
Change-Id: Ib296a2b20c7c13bd94b9c7f8b666c4d1213bbfcf
-rw-r--r-- | src/cn-cbor.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cn-cbor.c b/src/cn-cbor.c index a7677ae..8fadf73 100644 --- a/src/cn-cbor.c +++ b/src/cn-cbor.c @@ -52,7 +52,7 @@ static double decode_half(int half) { /* Fix these if you can't do non-aligned reads */ #define ntoh8p(p) (*(unsigned char*)(p)) #define ntoh16p(p) (ntohs(*(unsigned short*)(p))) -#define ntoh32p(p) (ntohl(*(unsigned long*)(p))) +#define ntoh32p(p) (ntohl(*(uint32_t*)(p))) static uint64_t ntoh64p(unsigned char *p) { uint64_t ret = ntoh32p(p); ret <<= 32; |