aboutsummaryrefslogtreecommitdiffstats
path: root/testing/enjoy/0001-fix-printf-format-specifier.patch
diff options
context:
space:
mode:
Diffstat (limited to 'testing/enjoy/0001-fix-printf-format-specifier.patch')
-rw-r--r--testing/enjoy/0001-fix-printf-format-specifier.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/testing/enjoy/0001-fix-printf-format-specifier.patch b/testing/enjoy/0001-fix-printf-format-specifier.patch
new file mode 100644
index 00000000000..01db8593865
--- /dev/null
+++ b/testing/enjoy/0001-fix-printf-format-specifier.patch
@@ -0,0 +1,28 @@
+From 33a2902f242ad95308a5970a88369d0100a4c66a Mon Sep 17 00:00:00 2001
+From: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
+Date: Wed, 23 Mar 2022 17:26:05 +0100
+Subject: [PATCH] fix printf format specifier
+
+`%ld` is the format specifier for long. The correct format specifier
+for `size_t` is `%zu`. Because `%zu` is somewhat obscure, cast the
+`size_t` variable to `long` instead and keep `%ld`.
+---
+ enjoy.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/enjoy.c b/enjoy.c
+index a698f17..4f0bf33 100644
+--- a/enjoy.c
++++ b/enjoy.c
+@@ -410,7 +410,7 @@ int main(int argc, char *argv[])
+ break;
+
+ char axis_as_mouse_key[20];
+- sprintf(axis_as_mouse_key, "axis%ld_as_mouse", axis);
++ sprintf(axis_as_mouse_key, "axis%zu_as_mouse", axis);
+ /* null to 0. */
+ if(!(atoi(cfg_get(cfg, axis_as_mouse_key) ? cfg_get(cfg, axis_as_mouse_key) : "0"))) {
+ if(axes[axis].x != 0 || axes[axis].y != 0)
+--
+2.35.1
+