summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index a68b8c2e6c..0a8540b48b 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -4383,9 +4383,10 @@ will work for offsets of 0, 2 and 4...
********************************************************************/
char *align_offset(char *q, char *base, int align_offset_len)
{
- if (align_offset_len != 0 && ((q - base) & (align_offset_len-1)))
+ int mod = ((q - base) & (align_offset_len-1));
+ if (align_offset_len != 0 && mod != 0)
{
- q += align_offset_len - ((q - base) & (align_offset_len));
+ q += align_offset_len - mod;
}
return q;
}