From 230bd5c2fd11f6256e1ab16c2e5997a8d8228461 Mon Sep 17 00:00:00 2001 From: "Jason St. John" Date: Fri, 8 Nov 2013 00:44:40 -0500 Subject: Fix whitespace and other formatting issues This commit: -- replaces space-based indents with tabs per the coding standards -- removes extraneous whitespace (e.g. extra spaces between function args) -- adds missing braces for a one-line if statement Signed-off-by: Jason St. John --- src/common/util-common.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/common') diff --git a/src/common/util-common.c b/src/common/util-common.c index 40623b92..e4a9de91 100644 --- a/src/common/util-common.c +++ b/src/common/util-common.c @@ -82,9 +82,9 @@ char *mdirname(const char *path) */ static size_t strnlen(const char *s, size_t max) { - register const char *p; - for(p = s; *p && max--; ++p); - return (p - s); + register const char *p; + for(p = s; *p && max--; ++p); + return (p - s); } /** Copies a string. @@ -95,14 +95,15 @@ static size_t strnlen(const char *s, size_t max) */ char *strndup(const char *s, size_t n) { - size_t len = strnlen(s, n); - char *new = (char *) malloc(len + 1); + size_t len = strnlen(s, n); + char *new = (char *) malloc(len + 1); - if(new == NULL) - return NULL; + if(new == NULL) { + return NULL; + } - new[len] = '\0'; - return (char *)memcpy(new, s, len); + new[len] = '\0'; + return (char *)memcpy(new, s, len); } #endif -- cgit v1.2.3-70-g09d2