You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/06/06 13:04:58 UTC
[GitHub] andrzej-kaczmarek closed pull request #1165: tinycbor: Fix cmp
return value from readers
andrzej-kaczmarek closed pull request #1165: tinycbor: Fix cmp return value from readers
URL: https://github.com/apache/mynewt-core/pull/1165
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/encoding/tinycbor/src/cbor_buf_reader.c b/encoding/tinycbor/src/cbor_buf_reader.c
index 0d8379c589..c8e1be1409 100644
--- a/encoding/tinycbor/src/cbor_buf_reader.c
+++ b/encoding/tinycbor/src/cbor_buf_reader.c
@@ -55,7 +55,7 @@ cbor_buf_reader_cmp(struct cbor_decoder_reader *d, char *dst, int src_offset,
size_t len)
{
struct cbor_buf_reader *cb = (struct cbor_buf_reader *) d;
- return memcmp(dst, cb->buffer + src_offset, len);
+ return memcmp(dst, cb->buffer + src_offset, len) == 0;
}
static uintptr_t
diff --git a/encoding/tinycbor/src/cbor_mbuf_reader.c b/encoding/tinycbor/src/cbor_mbuf_reader.c
index 07ecfc713f..3a00303fd1 100644
--- a/encoding/tinycbor/src/cbor_mbuf_reader.c
+++ b/encoding/tinycbor/src/cbor_mbuf_reader.c
@@ -66,7 +66,7 @@ cbor_mbuf_reader_cmp(struct cbor_decoder_reader *d, char *buf, int offset,
size_t len)
{
struct cbor_mbuf_reader *cb = (struct cbor_mbuf_reader *) d;
- return os_mbuf_cmpf(cb->m, offset + cb->init_off, buf, len);
+ return os_mbuf_cmpf(cb->m, offset + cb->init_off, buf, len) == 0;
}
static uintptr_t
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services