From: Danny Al-Gaaf Date: Thu, 28 Feb 2013 18:34:47 +0000 (+0100) Subject: librados/librados.cc: don't check unsigned 'len' against less than zero X-Git-Tag: v0.59~61^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bed61fcacbbcb3de6f9b52be4958444364edad29;p=ceph.git librados/librados.cc: don't check unsigned 'len' against less than zero Signed-off-by: Danny Al-Gaaf --- diff --git a/src/librados/librados.cc b/src/librados/librados.cc index aace7d57500f..c03a20f8d126 100644 --- a/src/librados/librados.cc +++ b/src/librados/librados.cc @@ -1543,7 +1543,7 @@ extern "C" int rados_pool_list(rados_t cluster, char *buf, size_t len) std::list::const_iterator i = pools.begin(); std::list::const_iterator p_end = pools.end(); for (; i != p_end; ++i) { - if (len <= 0) + if (len == 0) break; int rl = i->length() + 1; strncat(b, i->c_str(), len - 2); // leave space for two NULLs