summaryrefslogtreecommitdiff
path: root/lib/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mem.c')
-rw-r--r--lib/mem.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/mem.c b/lib/mem.c
index c6a78b1edd..b5ea1582ef 100644
--- a/lib/mem.c
+++ b/lib/mem.c
@@ -30,8 +30,8 @@ gnutls_alloc_function gnutls_malloc = malloc;
gnutls_free_function gnutls_free = free;
gnutls_realloc_function gnutls_realloc = realloc;
-void *(*gnutls_calloc) (size_t, size_t) = calloc;
-char *(*gnutls_strdup) (const char *) = _gnutls_strdup;
+void *(*gnutls_calloc)(size_t, size_t) = calloc;
+char *(*gnutls_strdup)(const char *) = _gnutls_strdup;
/* This realloc will free ptr in case realloc
* fails.
@@ -73,7 +73,7 @@ char *_gnutls_strdup(const char *str)
size_t siz;
char *ret;
- if(unlikely(!str))
+ if (unlikely(!str))
return NULL;
siz = strlen(str) + 1;
@@ -87,7 +87,7 @@ char *_gnutls_strdup(const char *str)
void *_gnutls_reallocarray(void *ptr, size_t nmemb, size_t size)
{
return xalloc_oversized(nmemb, size) ? NULL :
- gnutls_realloc(ptr, nmemb * size);
+ gnutls_realloc(ptr, nmemb * size);
}
#if 0
@@ -130,14 +130,14 @@ void gnutls_free(void *ptr)
/* Returns 1 if the provided buffer is all zero.
* It leaks no information via timing.
*/
-unsigned _gnutls_mem_is_zero(const uint8_t *ptr, unsigned size)
+unsigned _gnutls_mem_is_zero(const uint8_t * ptr, unsigned size)
{
unsigned i;
uint8_t res = 0;
- for (i=0;i<size;i++) {
+ for (i = 0; i < size; i++) {
res |= ptr[i];
}
- return ((res==0)?1:0);
+ return ((res == 0) ? 1 : 0);
}