MINOR: chunk: remove impossible tests on negative chunk->data
Since commit 843b7cb ("MEDIUM: chunks: make the chunk struct's fields
match the buffer struct") a chunk length is unsigned so we can remove
negative size checks.
diff --git a/include/common/chunk.h b/include/common/chunk.h
index a127f9a..383e157 100644
--- a/include/common/chunk.h
+++ b/include/common/chunk.h
@@ -117,7 +117,7 @@
static inline int chunk_memcat(struct buffer *chk, const char *src,
size_t len)
{
- if (unlikely(chk->data < 0 || chk->data + len >= chk->size))
+ if (unlikely(chk->data + len >= chk->size))
return 0;
memcpy(chk->area + chk->data, src, len);
@@ -152,7 +152,7 @@
len = strlen(str);
- if (unlikely(chk->data < 0 || chk->data + len >= chk->size))
+ if (unlikely(chk->data + len >= chk->size))
return 0;
memcpy(chk->area + chk->data, str, len + 1);
@@ -165,7 +165,7 @@
*/
static inline int chunk_strncat(struct buffer *chk, const char *str, int nb)
{
- if (unlikely(chk->data < 0 || chk->data + nb >= chk->size))
+ if (unlikely(chk->data + nb >= chk->size))
return 0;
memcpy(chk->area + chk->data, str, nb);
@@ -187,7 +187,7 @@
*/
static inline char *chunk_newstr(struct buffer *chk)
{
- if (chk->data < 0 || chk->data + 1 >= chk->size)
+ if (chk->data + 1 >= chk->size)
return NULL;
chk->area[chk->data++] = 0;
@@ -219,7 +219,7 @@
*/
static inline char *chunk_dup(struct buffer *dst, const struct buffer *src)
{
- if (!dst || !src || src->data < 0 || !src->area)
+ if (!dst || !src || !src->area)
return NULL;
if (dst->size)