diff options
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/chunk_generator.hh | 1 | ||||
-rw-r--r-- | src/base/statistics.hh | 2 | ||||
-rw-r--r-- | src/base/vnc/vncserver.cc | 2 |
3 files changed, 2 insertions, 3 deletions
diff --git a/src/base/chunk_generator.hh b/src/base/chunk_generator.hh index bc71a0569..cf303f693 100644 --- a/src/base/chunk_generator.hh +++ b/src/base/chunk_generator.hh @@ -83,7 +83,6 @@ class ChunkGenerator { // chunkSize must be a power of two assert(chunkSize == 0 || isPowerOf2(chunkSize)); - assert(totalSize >= 0); // set up initial chunk. curAddr = startAddr; diff --git a/src/base/statistics.hh b/src/base/statistics.hh index 8d6644284..7e5f1f5b9 100644 --- a/src/base/statistics.hh +++ b/src/base/statistics.hh @@ -1567,7 +1567,7 @@ class HistStor size_type index = (int64_t)std::floor((val - min_bucket) / bucket_size); - assert(index >= 0 && index < size()); + assert(index < size()); cvec[index] += number; sum += val * number; diff --git a/src/base/vnc/vncserver.cc b/src/base/vnc/vncserver.cc index d11308875..e762ad1d4 100644 --- a/src/base/vnc/vncserver.cc +++ b/src/base/vnc/vncserver.cc @@ -593,8 +593,8 @@ VncServer::recvCutText() size_t bytes_to_read = data_len > 1024 ? 1024 : data_len; len = read((uint8_t*)&str, bytes_to_read); str[bytes_to_read] = 0; + assert(len >= data_len); data_len -= len; - assert(data_len >= 0); DPRINTF(VNC, "Buffer: %s\n", str); } |