mbedtls_buffer_offset() function
Return an offset into a buffer. This is just the addition of an offset to a pointer, except that this function also accepts an offset of 0 into a buffer whose pointer is null. (`p + n` has undefined behavior when `p` is null, even when `n == 0`. A null pointer is a valid buffer pointer when the size is 0, for example as the result of `malloc(0)` on some platforms.)
Syntax
static inline unsigned char *mbedtls_buffer_offset(
unsigned char *p,
size_t n);
Arguments
p
Pointer to a buffer of at least n bytes. This may be \p NULL if \p n is zero.
Return value
Pointer to offset \p n in the buffer \p p. Note that this is only a valid pointer if the size of the buffer is at least \p n + 1.
mbedtls_buffer_offset() is called by 2 functions:
![]()
mbedtls_buffer_offset()
mbedtls_buffer_offset():
![]()
mbedtls_buffer_offset()