diff options
| author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-10-23 12:14:51 +0200 |
|---|---|---|
| committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2018-10-23 12:14:51 +0200 |
| commit | 2eb4a65ebd9aa04bd663fb9a7f0680fd2c56e990 (patch) | |
| tree | eb5f9616387784ec1a5914395a9e3355baca2ce4 /nx-X11/lib/modules/im/ximcp/imLcIm.c | |
| parent | 3dc4595560b34242fe4705af8c93d0024eeb2c56 (diff) | |
| parent | 701e702a121029098a6123bee9e43a9b81f4b3d9 (diff) | |
| download | nx-libs-2eb4a65ebd9aa04bd663fb9a7f0680fd2c56e990.tar.gz nx-libs-2eb4a65ebd9aa04bd663fb9a7f0680fd2c56e990.tar.bz2 nx-libs-2eb4a65ebd9aa04bd663fb9a7f0680fd2c56e990.zip | |
Merge branch 'uli42-pr/libX11_1.6.6' into 3.6.x
Attributes GH PR #722: https://github.com/ArcticaProject/nx-libs/pull/722
Diffstat (limited to 'nx-X11/lib/modules/im/ximcp/imLcIm.c')
| -rw-r--r-- | nx-X11/lib/modules/im/ximcp/imLcIm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nx-X11/lib/modules/im/ximcp/imLcIm.c b/nx-X11/lib/modules/im/ximcp/imLcIm.c index b3662bc96..41d4fb3fa 100644 --- a/nx-X11/lib/modules/im/ximcp/imLcIm.c +++ b/nx-X11/lib/modules/im/ximcp/imLcIm.c @@ -82,8 +82,8 @@ struct _XimCacheStruct { DTCharIndex mbused; DTCharIndex wcused; DTCharIndex utf8used; - char fname[1]; - /* char encoding[1] */ + char fname[]; + /* char encoding[] */ }; static struct _XimCacheStruct* _XimCache_mmap = NULL; @@ -281,7 +281,7 @@ _XimReadCachedDefaultTree( assert (m->id == XIM_CACHE_MAGIC); assert (m->version == XIM_CACHE_VERSION); if (size != m->size || - size < XOffsetOf (struct _XimCacheStruct, fname) + namelen + encodinglen) { + size < sizeof (struct _XimCacheStruct) + namelen + encodinglen) { fprintf (stderr, "Ignoring broken XimCache %s [%s]\n", name, encoding); munmap (m, size); return False; @@ -442,7 +442,7 @@ _XimWriteCachedDefaultTree( int fd; FILE *fp; struct _XimCacheStruct *m; - int msize = (XOffsetOf(struct _XimCacheStruct, fname) + int msize = (sizeof(struct _XimCacheStruct) + strlen(name) + strlen(encoding) + 2 + XIM_CACHE_TREE_ALIGNMENT-1) & -XIM_CACHE_TREE_ALIGNMENT; DefTreeBase *b = &im->private.local.base; |
