keyrings.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH keyutils] Fix format specifier for pointer subtraction
@ 2023-03-01 13:42 Alyssa Ross
  0 siblings, 0 replies; only message in thread
From: Alyssa Ross @ 2023-03-01 13:42 UTC (permalink / raw)
  To: David Howells; +Cc: keyrings, Alyssa Ross

Resolves the following compiler error:

keyctl_watch.c: In function 'consumer':
keyctl_watch.c:177:61: error: format '%zx' expects argument of type 'size_t', but argument 3 has type 'int' [-Werror=format=]
  177 |                                 fprintf(stderr, "NOTIFY[%03zx]: ty=%06x sy=%02x i=%08x\n",
      |                                                         ~~~~^
      |                                                             |
      |                                                             long unsigned int
      |                                                         %03x
  178 |                                         p - buffer, n.n.type, n.n.subtype, n.n.info);
      |                                         ~~~~~~~~~~
      |                                           |
      |                                           int

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
 keyctl_watch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/keyctl_watch.c b/keyctl_watch.c
index a70a19a..1436c08 100644
--- a/keyctl_watch.c
+++ b/keyctl_watch.c
@@ -179,7 +179,7 @@ int consumer(FILE *log, FILE *gc, int fd)
 			memcpy(&n, p, largest);
 
 			if (debug)
-				fprintf(stderr, "NOTIFY[%03zx]: ty=%06x sy=%02x i=%08x\n",
+				fprintf(stderr, "NOTIFY[%03tx]: ty=%06x sy=%02x i=%08x\n",
 					p - buffer, n.n.type, n.n.subtype, n.n.info);
 
 			len = n.n.info & WATCH_INFO_LENGTH;
-- 
2.37.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-01 13:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-01 13:42 [PATCH keyutils] Fix format specifier for pointer subtraction Alyssa Ross

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 NNTP newsgroup(s).