Experiment of notification via NotifyClient + JSON API

This commit is contained in:
Gioacchino Mazzurco 2018-06-29 16:03:09 +02:00
parent 130007b578
commit 1bc518041c
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
5 changed files with 142 additions and 50 deletions

View file

@ -244,9 +244,10 @@ bool getRawString(const void *data, uint32_t size, uint32_t *offset, std::string
}
/* check there is space for string */
if(len > size || size-len < *offset) // better than if(size < *offset + len) because it avoids integer overflow
if(len > size || size-len < *offset) // better than if(size < *offset + len) because it avoids integer overflow
{
std::cerr << "getRawString() not enough size" << std::endl;
std::cerr << "getRawString() not enough size" << std::endl;
print_stacktrace();
return false;
}
uint8_t *buf = &(((uint8_t *) data)[*offset]);