summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-03-10 16:13:39 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-03-10 16:13:39 +0100
commitf75aafb3a2ec7a53b1797db41b497e97558730f2 (patch)
tree4a122d29afa3b6b510366463fc4bca454dbcb557 /include
parent9de93c8e06da3f79929ac208b666fb562b48bd49 (diff)
Avoid undef use of null ptr, use offsetof instead
Change-Id: I47b1d8e7b119e50406b50f580ee06f9f1b5f8401
Diffstat (limited to 'include')
-rw-r--r--include/LibreOfficeKit/LibreOfficeKit.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index ea9846a585b7..d4b79067640d 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -25,8 +25,7 @@ typedef struct _LibreOfficeKitDocumentClass LibreOfficeKitDocumentClass;
// Do we have an extended member in this struct ?
#define LIBREOFFICEKIT_HAS_MEMBER(strct,member,nSize) \
- ((((size_t)((unsigned char *)&((strct *) 0)->member) + \
- sizeof ((strct *) 0)->member)) <= (nSize))
+ (offsetof(strct, member) < (nSize))
#define LIBREOFFICEKIT_HAS(pKit,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitClass,member,(pKit)->pClass->nSize)