From 81b5304fe5ea518680b2516e2da39f31c1d05afb Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Fri, 12 Mar 1999 19:53:28 +0000 Subject: [PATCH] Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL. --- source/lib/util.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/source/lib/util.c b/source/lib/util.c index 2bab2f0386e..30ad0a70652 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -2395,7 +2395,7 @@ BOOL get_unix_grps(int *p_ngroups, struct group **p_groups) DEBUG(10,("get_unix_grps\n")); - if (p_ngroups == NULL || *p_groups == NULL) + if (p_ngroups == NULL || p_groups == NULL) { return False; } @@ -2909,12 +2909,24 @@ enum remote_arch_types get_remote_arch(void) } +/******************************************************************* + align a pointer to a multiple of 4 bytes. + ********************************************************************/ +char *align4(char *q, char *base) +{ + int mod = PTR_DIFF(q, base) & 3; + if (mod != 0) + { + q += mod; + } + return q; +} /******************************************************************* align a pointer to a multiple of 2 bytes ********************************************************************/ char *align2(char *q, char *base) { - if ((q - base) & 1) + if (PTR_DIFF(q, base) & 1) { q++; }