From c7bb19c55c7a902e25bdd33b0d49a2ddcf62e07a Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sat, 22 Dec 2012 21:38:26 +0000 Subject: update C coding style to a more commonly used style git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1873 ef36b2f9-881f-0410-afb5-c4e39611909c --- compat/strndup.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'compat/strndup.c') diff --git a/compat/strndup.c b/compat/strndup.c index 9eb38a0..bd7c5d6 100644 --- a/compat/strndup.c +++ b/compat/strndup.c @@ -1,7 +1,7 @@ /* strndup.c - implementation of strndup() for systems that lack it - Copyright (C) 2011 Arthur de Jong + Copyright (C) 2011, 2012 Arthur de Jong This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -28,14 +28,14 @@ /* this is a strndup() replacement for systems that don't have it (strndup() is in POSIX 2008 now) */ -char *strndup(const char *s,size_t size) +char *strndup(const char *s, size_t size) { char *result; - result=(char *)malloc(size+1); - if (result!=NULL) + result = (char *)malloc(size + 1); + if (result != NULL) { - strncpy(result,s,size); - result[size]='\0'; + strncpy(result, s, size); + result[size] = '\0'; } return result; } -- cgit v1.2.3