1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

libsmb: Make SMBC_dlist_contains return bool

It returned True/False, and is used as boolean only. Modernize
formatting a bit.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Volker Lendecke 2020-02-21 22:13:49 +01:00 committed by Andreas Schneider
parent 66caa6b24d
commit 20b99b03a0
2 changed files with 10 additions and 8 deletions

View File

@ -430,8 +430,7 @@ SMBC_ftruncate_ctx(SMBCCTX *context,
/* Functions in libsmb_misc.c */
int
SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p);
bool SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p);
int
SMBC_errno(SMBCCTX *context,

View File

@ -31,15 +31,18 @@
/*
* check if an element is part of the list.
*/
int
SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p)
bool SMBC_dlist_contains(SMBCFILE * list, SMBCFILE *p)
{
if (!p || !list) return False;
if ((p == NULL) || (list == NULL)) {
return false;
}
do {
if (p == list) return True;
if (p == list) {
return true;
}
list = list->next;
} while (list);
return False;
} while (list != NULL);
return false;
}