chunk: Skip all leading zero bytes in chunk_skip_zero() not just the first

This commit is contained in:
Tobias Brunner
2016-04-04 15:39:42 +02:00
parent 85597f2983
commit b82b5f6398
2 changed files with 18 additions and 14 deletions
+2 -2
View File
@@ -280,11 +280,11 @@ static inline chunk_t chunk_skip(chunk_t chunk, size_t bytes)
}
/**
* Skip a leading zero-valued byte
* Skip any leading zero-valued bytes
*/
static inline chunk_t chunk_skip_zero(chunk_t chunk)
{
if (chunk.len > 1 && *chunk.ptr == 0x00)
while (chunk.len > 1 && *chunk.ptr == 0x00)
{
chunk.ptr++;
chunk.len--;