diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2012-12-22 22:38:26 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2012-12-22 22:38:26 +0100 |
commit | c7bb19c55c7a902e25bdd33b0d49a2ddcf62e07a (patch) | |
tree | b3a75ef2719bc2f334041460fd21fbdf86a23a82 /compat/strndup.c | |
parent | d336cd6b429f8ce40c58ea287f79bbc7c23d0966 (diff) |
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
Diffstat (limited to 'compat/strndup.c')
-rw-r--r-- | compat/strndup.c | 12 |
1 files changed, 6 insertions, 6 deletions
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; } |