Skip to content
Snippets Groups Projects
Commit c9460c81 authored by Niels Möller's avatar Niels Möller
Browse files

Use size_t for realloc functions.

parent 86fdb2ce
Branches
Tags
No related merge requests found
...@@ -40,7 +40,7 @@ typedef void nettle_random_func(void *ctx, ...@@ -40,7 +40,7 @@ typedef void nettle_random_func(void *ctx,
typedef void nettle_progress_func(void *ctx, int c); typedef void nettle_progress_func(void *ctx, int c);
/* Realloc function, used by struct nettle_buffer. */ /* Realloc function, used by struct nettle_buffer. */
typedef void *nettle_realloc_func(void *ctx, void *p, unsigned length); typedef void *nettle_realloc_func(void *ctx, void *p, size_t length);
/* Ciphers */ /* Ciphers */
typedef void nettle_set_key_func(void *ctx, typedef void nettle_set_key_func(void *ctx,
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
totally free the object, it is allowed to return a valid totally free the object, it is allowed to return a valid
pointer. */ pointer. */
void * void *
nettle_realloc(void *ctx UNUSED, void *p, unsigned length) nettle_realloc(void *ctx UNUSED, void *p, size_t length)
{ {
if (length > 0) if (length > 0)
return realloc(p, length); return realloc(p, length);
...@@ -45,7 +45,7 @@ nettle_realloc(void *ctx UNUSED, void *p, unsigned length) ...@@ -45,7 +45,7 @@ nettle_realloc(void *ctx UNUSED, void *p, unsigned length)
} }
void * void *
nettle_xrealloc(void *ctx UNUSED, void *p, unsigned length) nettle_xrealloc(void *ctx UNUSED, void *p, size_t length)
{ {
if (length > 0) if (length > 0)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment