gbranden pushed a commit to branch master
in repository groff.

commit 6ecdcfbb0e8eece6498b26cad5615012ff2fdba4
Author: G. Branden Robinson <g.branden.robin...@gmail.com>
AuthorDate: Tue Jun 3 23:49:36 2025 -0500

    [grotty]: Fix `-Wformat` compiler warning.
    
    * src/devices/grotty/tty.cpp (tty_printer::put_color): Fix `-Wformat`
      compiler warning; use `%lu` instead of `%u` conversion with
      `sprintf()` with `long` arguments.
---
 ChangeLog                  | 6 ++++++
 src/devices/grotty/tty.cpp | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 79977bd49..e82fc50d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-06-03  G. Branden Robinson <g.branden.robin...@gmail.com>
+
+       * src/devices/grotty/tty.cpp (tty_printer::put_color): Fix
+       `-Wformat` compiler warning; use `%lu` instead of `%u`
+       conversion with `sprintf()` with `long` arguments.
+
 2025-05-24  Deri James  <d...@chuzzlewit.myzen.co.uk>
 
        * src/devices/grotty/tty.cpp: Add support for devices supporting
diff --git a/src/devices/grotty/tty.cpp b/src/devices/grotty/tty.cpp
index c5f8b072a..1354b230a 100644
--- a/src/devices/grotty/tty.cpp
+++ b/src/devices/grotty/tty.cpp
@@ -747,7 +747,7 @@ void tty_printer::put_color(long color_index, int back)
     putstring(CSI);
     int fb = back ? 48 : 38;
     static char buf[24];
-    sprintf(buf,"%d;2;%u;%u;%um",fb, color_index>>16, (color_index>>8) & 0xff, 
color_index & 0xff);
+    sprintf(buf,"%d;2;%lu;%lu;%lum",fb, color_index>>16, (color_index>>8) & 
0xff, color_index & 0xff);
     putstring(buf);
   }
 }

_______________________________________________
groff-commit mailing list
groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to