From 0b04310b8ab0e6b19976415c09b6922f055850a5 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Mon, 13 Oct 1997 11:15:46 +0000 Subject: align_offset() adjusted pointer to wrong location. oops. (This used to be commit ba28678e3f673cd10d936f59ff0df6a852aca793) --- source3/lib/util.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source3') 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; } -- cgit