From 0fed0b5f864cf70e2ed3a82236fd81554f52948e Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 21 Oct 2023 13:33:25 +0200 Subject: X11: Use PUGL_INIT_STRUCT to initialize char arrays --- src/x11.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/x11.c b/src/x11.c index 07642fc..2de7d1c 100644 --- a/src/x11.c +++ b/src/x11.c @@ -665,7 +665,7 @@ puglRealize(PuglView* const view) updateSizeHints(view); // Set PID and hostname so the window manager can access our process - char hostname[256] = {0}; + char hostname[256] = PUGL_INIT_STRUCT; const long pid = (long)getpid(); if (pid > 0 && !gethostname(hostname, sizeof(hostname))) { hostname[sizeof(hostname) - 1] = '\0'; @@ -884,7 +884,7 @@ translateKey(PuglView* const view, XEvent* const xevent, PuglEvent* const event) xevent->xkey.state = xevent->xkey.state & ~(unsigned)(ControlMask|ShiftMask); // Lookup unshifted key - char ustr[8] = {0}; + char ustr[8] = PUGL_INIT_STRUCT; KeySym sym = 0; const int ufound = XLookupString(&xevent->xkey, ustr, 8, &sym, NULL); const PuglKey special = keySymToSpecial(sym); @@ -899,7 +899,7 @@ translateKey(PuglView* const view, XEvent* const xevent, PuglEvent* const event) // Lookup shifted key for possible text event xevent->xkey.state = state; - char sstr[8] = {0}; + char sstr[8] = PUGL_INIT_STRUCT; const int sfound = lookupString(view->impl->xic, xevent, sstr, &sym); if (sfound > 0) { // Dispatch key event now -- cgit v1.2.1