From 3121eeb5e68bedd6e2398f35b9bd60b69709a47e Mon Sep 17 00:00:00 2001 From: Josselin Poiret Date: Tue, 14 Dec 2021 18:49:54 +0100 Subject: [PATCH] Replace hardcoded command length --- src/screenshot/screenshot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/screenshot/screenshot.c b/src/screenshot/screenshot.c index 9df0ea7..5f27681 100644 --- a/src/screenshot/screenshot.c +++ b/src/screenshot/screenshot.c @@ -42,8 +42,9 @@ static bool exec_screenshooter_interactive(const char *path) { perror("fork"); return false; } else if (pid == 0) { - char cmd[strlen(path) + 25]; - snprintf(cmd, sizeof(cmd), "grim -g \"$(slurp)\" -- %s", path); + const char cmd_fmt[] = "grim -g \"$(slurp)\" -- %s"; + char cmd[strlen(path) + sizeof(cmd_fmt)]; + snprintf(cmd, sizeof(cmd), cmd_fmt, path); execl("/bin/sh", "/bin/sh", "-c", cmd, NULL); perror("execl"); exit(127); -- 2.34.0 lass='sub'>Wojtek's customized Guix
aboutsummaryrefslogtreecommitdiff
path: root/gnu/installer/keymap.scm
AgeCommit message (Collapse)Author
2021-09-21installer: keymap: Fix optional fields handling.Mathieu Othacehe
Fixes: <https://issues.guix.gnu.org/50723>. The keymap xml contains optional shortDescription and description fields. The assoc-ref call on those fields can return false, handle it correctly. * gnu/installer/keymap.scm (xkb-rules->models+layouts): Introduce a new "maybe-empty" helper to deal with optional fields. Use it for shortDescription and description fields.
2020-04-09installer: Allow Alt+Shift toggle from non-Latin keyboard layouts.Florian Pelz
Fixes <https://bugs.gnu.org/40493>. * gnu/installer/newt/keymap.scm (%non-latin-layouts): New variable. (%non-latin-variants): New variable. (%latin-layout+variants): New variable. (toggleable-latin-layout): New procedure to compute combined layouts. (run-keymap-page): Use it. (keyboard-layout->configuration): Apply it in config.scm. (run-layout-page): Mention Alt+Shift. * gnu/installer/keymap.scm (kmscon-update-keymap): Pass on XKB options. * gnu/installer/record.scm (<installer>): Adjust code comments. * gnu/installer.scm (apply-keymap): Pass on XKB options. (installer-steps): Adjust code comments. * gnu/packages/patches/kmscon-runtime-keymap-switch.patch: Apply XKB options.