You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by we...@apache.org on 2016/03/22 05:24:18 UTC

incubator-mynewt-core git commit: Modify os_mbuf_copydata() such that if m==NULL and len==0 we return 0 instead of -1

Repository: incubator-mynewt-core
Updated Branches:
  refs/heads/develop e8a365bd7 -> 5119fa2d0


Modify os_mbuf_copydata() such that if m==NULL and len==0 we return 0 instead of -1


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/5119fa2d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/5119fa2d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/5119fa2d

Branch: refs/heads/develop
Commit: 5119fa2d04469fe9f1e638759699ad1f246b80cd
Parents: e8a365b
Author: wes3 <wi...@micosa.io>
Authored: Mon Mar 21 21:21:08 2016 -0700
Committer: wes3 <wi...@micosa.io>
Committed: Mon Mar 21 21:22:07 2016 -0700

----------------------------------------------------------------------
 libs/os/src/os_mbuf.c | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/5119fa2d/libs/os/src/os_mbuf.c
----------------------------------------------------------------------
diff --git a/libs/os/src/os_mbuf.c b/libs/os/src/os_mbuf.c
index 68afb52..b41ded6 100644
--- a/libs/os/src/os_mbuf.c
+++ b/libs/os/src/os_mbuf.c
@@ -539,6 +539,10 @@ os_mbuf_copydata(const struct os_mbuf *m, int off, int len, void *dst)
     unsigned int count;
     uint8_t *udst;
 
+    if (!len) {
+        return 0;
+    }
+
     udst = dst;
 
     while (off > 0) {