summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1997-10-13 11:15:46 +0000
committerLuke Leighton <lkcl@samba.org>1997-10-13 11:15:46 +0000
commit0b04310b8ab0e6b19976415c09b6922f055850a5 (patch)
tree6dc829179ebc8bba13cc36d0b000882c6cff3b21
parent95625a91668317f0d6a15fa767b3507c1cbeb88d (diff)
downloadsamba-0b04310b8ab0e6b19976415c09b6922f055850a5.tar.gz
samba-0b04310b8ab0e6b19976415c09b6922f055850a5.tar.bz2
samba-0b04310b8ab0e6b19976415c09b6922f055850a5.zip
align_offset() adjusted pointer to wrong location. oops.
(This used to be commit ba28678e3f673cd10d936f59ff0df6a852aca793)
-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;
}