summaryrefslogtreecommitdiffstats
path: root/testsuite/nsswitch/getgrent_r.c
diff options
context:
space:
mode:
authorSlava Semushin <php-coder@altlinux.ru>2009-06-06 21:53:38 +0700
committerVolker Lendecke <vl@samba.org>2009-06-06 22:45:02 +0200
commit3f5403220f2e3c0df4e436f908b97fe8cafd6616 (patch)
tree7fc1b4d3db92717fdc527e7307a70f8402c196c8 /testsuite/nsswitch/getgrent_r.c
parent497b9e460b5defd60de89b9c5bed890f83ca86a1 (diff)
downloadsamba-3f5403220f2e3c0df4e436f908b97fe8cafd6616.tar.gz
samba-3f5403220f2e3c0df4e436f908b97fe8cafd6616.tar.xz
samba-3f5403220f2e3c0df4e436f908b97fe8cafd6616.zip
testsuite/nsswitch/get{gr,pw}ent_r.c(dump_{gr,pw}ent): fixed wrong condition.
When fopen() fails it return NULL, so condition where return value less than zero never evaluated to truth. Found by cppcheck.
Diffstat (limited to 'testsuite/nsswitch/getgrent_r.c')
-rw-r--r--testsuite/nsswitch/getgrent_r.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/testsuite/nsswitch/getgrent_r.c b/testsuite/nsswitch/getgrent_r.c
index 3eac8aa218d..4f1f0ce8f5e 100644
--- a/testsuite/nsswitch/getgrent_r.c
+++ b/testsuite/nsswitch/getgrent_r.c
@@ -21,7 +21,7 @@ void dump_grent(char *id)
sprintf(fname, "/tmp/getgrent_r-%s.out-%d", id, getpid());
- if ((fptr = fopen(fname, "w")) < 0) {
+ if ((fptr = fopen(fname, "w")) == NULL) {
fprintf(stderr, "ERROR: could not open file %s: %s\n", fname,
sys_errlist[errno]);
return;