represent 0 as a single byte
authorAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 3 Apr 2012 12:19:37 +0000 (14:19 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Tue, 3 Apr 2012 12:19:37 +0000 (14:19 +0200)
src/libstrongswan/chunk.h

index 4ff686f..3de02ee 100644 (file)
@@ -239,12 +239,8 @@ static inline chunk_t chunk_skip(chunk_t chunk, size_t bytes)
  */
 static inline chunk_t chunk_skip_zero(chunk_t chunk)
 {
-       if (chunk.len && *chunk.ptr == 0x00)
+       if (chunk.len > 1 && *chunk.ptr == 0x00)
        {
-               if (chunk.len == 1)
-               {
-                       return chunk_empty;
-               }
                chunk.ptr++;
                chunk.len--;
        }