Code

Moved core/error to utils/error.
[sysdb.git] / src / utils / proto.c
index e9e3e6c7ca9984396a2c55bb4b299cd3be34ef4a..29783efd5aefb3db7cd09037f6f534fa4363b020 100644 (file)
@@ -25,8 +25,8 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include "utils/error.h"
 #include "utils/proto.h"
-#include "core/error.h"
 
 #include <arpa/inet.h>
 #include <errno.h>
@@ -106,7 +106,7 @@ sdb_proto_get_int(sdb_strbuf_t *buf, size_t offset)
                return UINT32_MAX;
 
        /* not enough data to read */
-       if (offset + sizeof(uint32_t) < sdb_strbuf_len(buf))
+       if (offset + sizeof(uint32_t) > sdb_strbuf_len(buf))
                return UINT32_MAX;
 
        data = sdb_strbuf_string(buf);