diff --git a/src/adwm.c b/src/adwm.c index c5e2f29..2e504be 100644 --- a/src/adwm.c +++ b/src/adwm.c @@ -6792,10 +6792,10 @@ xerror(Display *dsply, XErrorEvent *ee) EPRINTF("\tFailed request %lu\n", ee->serial); if (trap) EPRINTF("\tNext request trap %lu\n", trap->trap_next); - EPRINTF("\tNext request now %lu\n", NextRequest(dsply)); + EPRINTF("\tNext request now %lu\n", NextRequest(dsply)); if (trap) EPRINTF("\tLast known processed request trap %lu\n", trap->trap_last); - EPRINTF("\tLast known processed request now %lu\n", LastKnownRequestProcessed(dsply)); + EPRINTF("\tLast known processed request now %lu\n", LastKnownRequestProcessed(dsply)); if (critical || ignore) dumpstack(__FILE__, __LINE__, __func__); if (!critical || ignore) { @@ -7022,7 +7022,7 @@ main(int argc, char *argv[]) case 0: goto bad_usage; case 'f': /* -f, --file {PATH/}FILE */ - snprintf(conf, sizeof(conf) - 1, optarg); + strncpy(conf, optarg, sizeof(conf) - 1); break; case 'c': /* -c, --clientId ID */ free(clientid); diff --git a/src/adwm_adwm.c b/src/adwm_adwm.c index 34a4cbe..53029db 100644 --- a/src/adwm_adwm.c +++ b/src/adwm_adwm.c @@ -672,7 +672,7 @@ inittags_ADWM(Bool reload) snprintf(name, sizeof(name), "adwm.screen%u.tags.name%u", s, i); snprintf(clas, sizeof(clas), "Adwm.Screen%u.Tags.Name%u", s, i); res = readres(name, clas, def); - snprintf(t->name, sizeof(t->name), res); + strncpy(t->name, res, sizeof(t->name) - 1); } scr->ntags = scr->options.ntags; diff --git a/src/config.c b/src/config.c index 3692afc..208b326 100644 --- a/src/config.c +++ b/src/config.c @@ -24,7 +24,7 @@ inittags(Bool reload __attribute__((unused))) snprintf(def, sizeof(def), " %u ", i + 1); snprintf(resource, sizeof(resource), "tags.name%u", i); res = getscreenres(resource, def); - snprintf(t->name, sizeof(t->name), res); + strncpy(t->name, res, sizeof(t->name) - 1); XPRINTF("initialized tag %u to %s\n", i, res); } scr->ntags = scr->options.ntags;