aboutsummaryrefslogtreecommitdiff
path: root/src/compat.c
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2018-08-14 02:28:22 +0200
committerToni Uhlig <matzeton@googlemail.com>2018-08-14 02:28:22 +0200
commit4f15e80ce4bfabdf86fe92892b0b8f9adcaceca7 (patch)
tree2ef71c1f5c4779ae08c647be4eb614de9a0a0ed8 /src/compat.c
parent2d52167be3846c076518ddd28d5ad1d55fdd33e0 (diff)
fixed some code style issues reported by codacy
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/compat.c')
-rw-r--r--src/compat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compat.c b/src/compat.c
index 72c78a3..33d250a 100644
--- a/src/compat.c
+++ b/src/compat.c
@@ -68,11 +68,12 @@ potd_localtime(const time_t *timep, struct tm *result)
int
potd_getpwnam(const char *name, struct passwd *pwd)
{
- struct passwd *result = NULL;
+ struct passwd *result;
errno = 0;
#ifdef HAVE_GETPWNAM_R
char buf[BUFSIZ];
+ result = NULL;
return getpwnam_r(name, pwd, buf, sizeof buf, &result) || !result;
#else
@@ -87,11 +88,12 @@ potd_getpwnam(const char *name, struct passwd *pwd)
int
potd_getgrnam(const char *name, struct group *grp)
{
- struct group *result = NULL;
+ struct group *result;
errno = 0;
#ifdef HAVE_GETGRNAM_R
char buf[BUFSIZ];
+ result = NULL;
return getgrnam_r(name, grp, buf, sizeof buf, &result) || !result;
#else