This patch is from upstream and shouldn't be needed in the next release. https://github.com/philj56/tofi/commit/667075f0920da3c2b353fbce54b6430c195ef031.patch From 667075f0920da3c2b353fbce54b6430c195ef031 Mon Sep 17 00:00:00 2001 From: Phil Jones Date: Sun, 30 Apr 2023 20:08:57 +0100 Subject: [PATCH] Replace `strto[u]l` with `strto[u]ll`. On 32-bit systems, using `strtoul` was causing negative values for unsigned options to be treated as valid, as the value was being parsed as a 32-bit unsigned int, then cast to a 64-bit signed int, which remained positive. --- src/color.c | 8 ++++---- src/config.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/color.c b/src/color.c index 4b6b356..b1d5e90 100644 --- a/src/color.c +++ b/src/color.c @@ -22,7 +22,7 @@ struct color hex_to_color(const char *hex) hex[2], hex[2], '\0'}; char *endptr; - tmp = strtol(str, &endptr, 16); + tmp = strtoll(str, &endptr, 16); if (errno || *endptr != '\0' || tmp < 0) { return (struct color) { -1, -1, -1, -1 }; } @@ -37,14 +37,14 @@ struct color hex_to_color(const char *hex) hex[3], hex[3], '\0'}; char *endptr; - tmp = strtol(str, &endptr, 16); + tmp = strtoll(str, &endptr, 16); if (errno || *endptr != '\0' || tmp < 0) { return (struct color) { -1, -1, -1, -1 }; } val = tmp; } else if (len == 6) { char *endptr; - tmp = strtol(hex, &endptr, 16); + tmp = strtoll(hex, &endptr, 16); if (errno || *endptr != '\0' || tmp < 0) { return (struct color) { -1, -1, -1, -1 }; } @@ -53,7 +53,7 @@ struct color hex_to_color(const char *hex) val |= 0xFFu; } else if (len == 8) { char *endptr; - tmp = strtol(hex, &endptr, 16); + tmp = strtoll(hex, &endptr, 16); if (errno || *endptr != '\0' || tmp < 0) { return (struct color) { -1, -1, -1, -1 }; } diff --git a/src/config.c b/src/config.c index 2b85028..556199d 100644 --- a/src/config.c +++ b/src/config.c @@ -1027,7 +1027,7 @@ uint32_t parse_uint32(const char *filename, size_t lineno, const char *str, bool { errno = 0; char *endptr; - int64_t ret = strtoul(str, &endptr, 0); + int64_t ret = strtoull(str, &endptr, 0); if (endptr == str || *endptr != '\0') { PARSE_ERROR(filename, lineno, "Failed to parse \"%s\" as unsigned int.\n", str); if (err) { @@ -1046,7 +1046,7 @@ int32_t parse_int32(const char *filename, size_t lineno, const char *str, bool * { errno = 0; char *endptr; - int64_t ret = strtol(str, &endptr, 0); + int64_t ret = strtoll(str, &endptr, 0); if (endptr == str || *endptr != '\0') { PARSE_ERROR(filename, lineno, "Failed to parse \"%s\" as int.\n", str); if (err) { @@ -1065,7 +1065,7 @@ struct uint32_percent parse_uint32_percent(const char *filename, size_t lineno, { errno = 0; char *endptr; - int64_t val = strtoul(str, &endptr, 0); + int64_t val = strtoull(str, &endptr, 0); bool percent = false; if (endptr == str || (*endptr != '\0' && *endptr != '%')) { PARSE_ERROR(filename, lineno, "Failed to parse \"%s\" as unsigned int.\n", str); ilosavljevic <dannym@scratchpost.org> Raghav Gururajan 2020-08-18gnu: Add libbraille....* gnu/packages/accessibility.scm (libbraille): New variable. Signed-off-by: Danny Milosavljevic <dannym@scratchpost.org> Raghav Gururajan 2020-05-13mailmap: Update entries for Nikita....* .mailmap: change email and name for Nikita. * Makefile.am, doc/guix.texi, etc/completion/fish/guix.fish, gnu/packages/accessibility.scm, gnu/packages/admin.scm, gnu/packages/audio.scm, gnu/packages/autotools.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/cinnamon.scm, gnu/packages/compression.scm, gnu/packages/crypto.scm, gnu/packages/databases.scm, gnu/packages/django.scm, gnu/packages/dns.scm, gnu/packages/elixir.scm, gnu/packages/emacs-xyz.scm, gnu/packages/emacs.scm, gnu/packages/enlightenment.scm, gnu/packages/erlang.scm, gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/forth.scm, gnu/packages/fvwm.scm, gnu/packages/games.scm, gnu/packages/gl.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile-xyz.scm, gnu/packages/haskell-apps.scm, gnu/packages/haskell-check.scm, gnu/packages/haskell-crypto.scm, gnu/packages/haskell-xyz.scm, gnu/packages/haskell.scm, gnu/packages/image-viewers.scm, gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/language.scm, gnu/packages/libcanberra.scm, gnu/packages/linux.scm, gnu/packages/lisp-xyz.scm, gnu/packages/lisp.scm, gnu/packages/lolcode.scm, gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/mail.scm, gnu/packages/markup.scm, gnu/packages/mate.scm, gnu/packages/maths.scm, gnu/packages/mc.scm, gnu/packages/messaging.scm, gnu/packages/music.scm, gnu/packages/ncurses.scm, gnu/packages/networking.scm, gnu/packages/nickle.scm, gnu/packages/openbox.scm, gnu/packages/pdf.scm, gnu/packages/perl-check.scm, gnu/packages/perl.scm, gnu/packages/python-compression.scm, gnu/packages/python-crypto.scm, gnu/packages/python-web.scm, gnu/packages/python-xyz.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/ruby.scm, gnu/packages/rust.scm, gnu/packages/scheme.scm, gnu/packages/serialization.scm, gnu/packages/shells.scm, gnu/packages/ssh.scm, gnu/packages/suckless.scm, gnu/packages/tbb.scm, gnu/packages/telephony.scm, gnu/packages/text-editors.scm, gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm, gnu/packages/tor.scm, gnu/packages/version-control.scm, gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/web.scm, gnu/packages/wm.scm, gnu/packages/xdisorg.scm, gnu/packages/xfce.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/services/certbot.scm, gnu/services/desktop.scm, gnu/services/version-control.scm, gnu/services/web.scm, guix/import/hackage.scm, guix/licenses.scm: Likewise. Signed-off-by: Efraim Flashner <efraim@flashner.co.il> nikita