aboutsummaryrefslogtreecommitdiffstats
path: root/uid_db.c
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2016-12-11 15:27:08 +0100
committerMatthias Andree <matthias.andree@gmx.de>2016-12-11 22:06:12 +0100
commitab4dd923d778048d5ba4a0bab7e730d0c157b322 (patch)
tree457480487346cdb8ffc5105d0791891e158893f9 /uid_db.c
parente77d739e6a5ef96607f21229fb03530934b71d75 (diff)
downloadfetchmail-ab4dd923d778048d5ba4a0bab7e730d0c157b322.tar.gz
fetchmail-ab4dd923d778048d5ba4a0bab7e730d0c157b322.tar.bz2
fetchmail-ab4dd923d778048d5ba4a0bab7e730d0c157b322.zip
Fix portability to C90 and C++.
Diffstat (limited to 'uid_db.c')
-rw-r--r--uid_db.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/uid_db.c b/uid_db.c
index 97b1c2ba..18f4d6b3 100644
--- a/uid_db.c
+++ b/uid_db.c
@@ -10,12 +10,13 @@
/* Have Solaris expose ffs() from strings.h: */
#define __EXTENSIONS__
+#define _XOPEN_SOURCE 700
/* includes */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <strings.h> // ffs() lives here - needs #define on Solaris.
+#include <strings.h> /* ffs() lives here - needs #define on Solaris. */
#include "xmalloc.h"
#include "uid_db.h"
@@ -94,8 +95,8 @@ static struct pat_node *walk_down(struct uid_db *db, struct uid_db_record *rec,
*parentp =
(struct pat_node *)
((unsigned char *)edge - (v & bit_mask(bit_ndx) ?
- offsetof(struct pat_node, ptrs_[2])
- : offsetof(struct pat_node, ptrs_[0])));
+ offsetof(struct pat_node, ptrs_) + 2 * sizeof(struct pat_node *)
+ : offsetof(struct pat_node, ptrs_)));
*edgep = edge;
return cur;
}