char *Curl_dyn_ptr(const struct dynbuf *s);
-Returns a `char *` to the buffer. Since the buffer may be reallocated, this
-pointer should not be trusted or used anymore after the next buffer
-manipulation call.
+Returns a `char *` to the buffer if it has a length, otherwise a NULL. Since
+the buffer may be reallocated, this pointer should not be trusted or used
+anymore after the next buffer manipulation call.
## uptr
unsigned char *Curl_dyn_uptr(const struct dynbuf *s);
-Returns an `unsigned char *` to the buffer. Since the buffer may be
-reallocated, this pointer should not be trusted or used anymore after the next
-buffer manipulation call.
+Returns an `unsigned char *` to the buffer if it has a length, otherwise a
+NULL. Since the buffer may be reallocated, this pointer should not be trusted
+or used anymore after the next buffer manipulation call.
## len
DEBUGASSERT(s);
DEBUGASSERT(s->init == DYNINIT);
DEBUGASSERT(!s->leng || s->bufr);
- return s->leng ? s->bufr : (char *)"";
+ return s->bufr;
}
/*
DEBUGASSERT(s);
DEBUGASSERT(s->init == DYNINIT);
DEBUGASSERT(!s->leng || s->bufr);
- return s->leng ? (unsigned char *)s->bufr : (unsigned char *)"";
+ return (unsigned char *)s->bufr;
}
/*