1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-29 21:14:28 +01:00

assert() is only called when TINS_DEBUG is defined.

This commit is contained in:
Matias Fontanini
2013-04-22 18:45:56 -03:00
parent 7e0e85db65
commit 66ff604580
25 changed files with 115 additions and 8626 deletions

View File

@@ -27,7 +27,9 @@
*
*/
#ifdef TINS_DEBUG
#include <cassert>
#endif
#include <cstring>
#include "icmpv6.h"
#include "ipv6.h"
@@ -217,6 +219,7 @@ void ICMPv6::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU *
for(options_type::const_iterator it = _options.begin(); it != _options.end(); ++it) {
#ifdef TINS_DEBUG
assert(total_sz >= it->data_size() + sizeof(uint8_t) * 2);
// total_sz is only used if TINS_DEBUG is defined.
total_sz -= it->data_size() + sizeof(uint8_t) * 2;
#endif
buffer = write_option(*it, buffer);