public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] cygutils-extra 1.4.16-3: cygdrop: Fix printf format strings
@ 2021-08-14 13:57 Christian Franke
  2021-08-14 21:23 ` Mark Geisert
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Franke @ 2021-08-14 13:57 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 296 bytes --]

This fixes an unrelated bug found during analysis of the cygdrop crash.

In theory, the bug affects the 64-bit version (which didn't exist when I 
contributed this tool in 2009).
In practice, it doesn't because 64-bit ABI uses registers to pass the 
first args of a va_list.

Regards,
Christian


[-- Attachment #2: 0001-cygdrop-Fix-printf-format-strings.patch --]
[-- Type: text/plain, Size: 1037 bytes --]

From 4cf442906ea9654543dd6683960993361f02e525 Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.franke@t-online.de>
Date: Sat, 14 Aug 2021 15:14:27 +0200
Subject: [PATCH] cygdrop: Fix printf format strings.

---
 src/cygdrop/cygdrop.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cygdrop/cygdrop.cc b/src/cygdrop/cygdrop.cc
index dc403c9..0c036bb 100644
--- a/src/cygdrop/cygdrop.cc
+++ b/src/cygdrop/cygdrop.cc
@@ -378,7 +378,7 @@ main (int argc, char **argv)
 	     ? " [logon_id]"  : ""));
 	  const struct group * g = strsid_to_group (strsid);
 	  if (g)
-	    printf (" gid=%lu(%s)", g->gr_gid, g->gr_name);
+	    printf (" gid=%u(%s)", (unsigned) g->gr_gid, g->gr_name);
 	  printf ("\n");
 	}
 
@@ -415,7 +415,7 @@ main (int argc, char **argv)
 	printf ("r   %s", strsid);
 	const struct group * g = strsid_to_group (strsid);
 	if (g)
-	  printf (" gid=%lu(%s)", g->gr_gid, g->gr_name);
+	  printf (" gid=%u(%s)", (unsigned) g->gr_gid, g->gr_name);
 	printf ("\n");
       }
 
-- 
2.32.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cygutils-extra 1.4.16-3: cygdrop: Fix printf format strings
  2021-08-14 13:57 [PATCH] cygutils-extra 1.4.16-3: cygdrop: Fix printf format strings Christian Franke
@ 2021-08-14 21:23 ` Mark Geisert
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Geisert @ 2021-08-14 21:23 UTC (permalink / raw)
  To: cygwin

Christian Franke wrote:
> This fixes an unrelated bug found during analysis of the cygdrop crash.
> 
> In theory, the bug affects the 64-bit version (which didn't exist when I 
> contributed this tool in 2009).
> In practice, it doesn't because 64-bit ABI uses registers to pass the first args 
> of a va_list.
> 
> Regards,
> Christian

Thank you Christian for the two patches.  They'll be part of an upcoming cygutils* 
1.4.16-4 release this weekend.

..mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-14 21:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-14 13:57 [PATCH] cygutils-extra 1.4.16-3: cygdrop: Fix printf format strings Christian Franke
2021-08-14 21:23 ` Mark Geisert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).