From 47b10cf48b3ad69b585bb1011091af6fc16aa253 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Mon, 27 Dec 2010 23:26:56 -0500 Subject: [PATCH] tools: fix signed comparison warnings in bfuse --- tools/bfuse.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/bfuse.cc b/tools/bfuse.cc index ad5d2156..123bd10d 100644 --- a/tools/bfuse.cc +++ b/tools/bfuse.cc @@ -453,7 +453,7 @@ public: string data = GetRecordData(ps.Record()); size_t len = data.size(); - if( offset < len ) { + if( offset >= 0 && offset < (off_t)len ) { if( (offset + size) > len ) size = len - offset; memcpy(buf, data.data() + offset, size); @@ -599,7 +599,7 @@ public: virtual int ReadFile(const char *path, char *buf, size_t size, off_t offset) { size_t len = m_error_log.size(); - if( offset < len ) { + if( offset >= 0 && offset < (off_t)len ) { if( (offset + size) > len ) size = len - offset; memcpy(buf, m_error_log.data() + offset, size); -- 2.11.4.GIT