diff options
Diffstat (limited to 'xorg-server/Xext/xf86bigfont.c')
-rw-r--r-- | xorg-server/Xext/xf86bigfont.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/xorg-server/Xext/xf86bigfont.c b/xorg-server/Xext/xf86bigfont.c index 9de785678..b4ef5e460 100644 --- a/xorg-server/Xext/xf86bigfont.c +++ b/xorg-server/Xext/xf86bigfont.c @@ -71,6 +71,7 @@ #include "gcstruct.h" #include "dixfontstr.h" #include "extnsionst.h" +#include "extinit.h" #include "protocol-versions.h" #include <X11/extensions/xf86bigfproto.h> @@ -277,25 +278,23 @@ ProcXF86BigfontQueryVersion(ClientPtr client) xXF86BigfontQueryVersionReply reply; REQUEST_SIZE_MATCH(xXF86BigfontQueryVersionReq); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION; - reply.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION; - reply.uid = geteuid(); - reply.gid = getegid(); + reply = (xXF86BigfontQueryVersionReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION, + .minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION, + .uid = geteuid(), + .gid = getegid(), #ifdef HAS_SHM - reply.signature = signature; + .signature = signature, + .capabilities = (LocalClient(client) && !client->swapped) + ? XF86Bigfont_CAP_LocalShm : 0 #else - reply.signature = 0; /* This is redundant. Avoids uninitialized memory. */ + .signature = 0, + .capabilities = 0 #endif - reply.capabilities = -#ifdef HAS_SHM - (LocalClient(client) && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0) -#else - 0 -#endif - ; /* may add more bits here in future versions */ + }; if (client->swapped) { char tmp; @@ -307,8 +306,7 @@ ProcXF86BigfontQueryVersion(ClientPtr client) swapl(&reply.gid); swapl(&reply.signature); } - WriteToClient(client, - sizeof(xXF86BigfontQueryVersionReply), (char *) &reply); + WriteToClient(client, sizeof(xXF86BigfontQueryVersionReply), &reply); return Success; } @@ -555,7 +553,7 @@ ProcXF86BigfontQueryFont(ClientPtr client) ? nUniqCharInfos * sizeof(xCharInfo) + (nCharInfos + 1) / 2 * 2 * sizeof(CARD16) : 0); - xXF86BigfontQueryFontReply *reply = malloc(rlength); + xXF86BigfontQueryFontReply *reply = calloc(1, rlength); char *p; if (!reply) { @@ -644,7 +642,7 @@ ProcXF86BigfontQueryFont(ClientPtr client) } } } - WriteToClient(client, rlength, (char *) reply); + WriteToClient(client, rlength, reply); free(reply); if (nCharInfos > 0) { if (shmid == -1) |