diff options
author | Luke Leighton <lkcl@samba.org> | 1997-10-13 11:15:46 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1997-10-13 11:15:46 +0000 |
commit | ba28678e3f673cd10d936f59ff0df6a852aca793 (patch) | |
tree | 087aaf4f9a15901d8f8c4c049f1296a48cb1f3dc /source/lib/util.c | |
parent | 60bb523c8a67065d0ede732e1c153f37a8a865b6 (diff) | |
download | samba-ba28678e3f673cd10d936f59ff0df6a852aca793.tar.gz samba-ba28678e3f673cd10d936f59ff0df6a852aca793.tar.xz samba-ba28678e3f673cd10d936f59ff0df6a852aca793.zip |
align_offset() adjusted pointer to wrong location. oops.
Diffstat (limited to 'source/lib/util.c')
-rw-r--r-- | source/lib/util.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index a68b8c2e6c1..0a8540b48b4 100644 --- a/source/lib/util.c +++ b/source/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; } |