diff options
Diffstat (limited to 'lib/mem.c')
-rw-r--r-- | lib/mem.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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); } |