selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: selinux@vger.kernel.org
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Subject: [PATCH] libsepol: ibpkeys.c: fix printf format string specifiers for subnet_prefix
Date: Mon,  5 Nov 2018 09:38:38 -0500	[thread overview]
Message-ID: <20181105143838.5198-1-sds@tycho.nsa.gov> (raw)

Use PRIx64 to print the subnet_prefix (which is a uint64_t) instead
of lx.

Fixes https://github.com/SELinuxProject/selinux/issues/108

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
---
 libsepol/src/ibpkeys.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libsepol/src/ibpkeys.c b/libsepol/src/ibpkeys.c
index 682bf5db..68a9bdfe 100644
--- a/libsepol/src/ibpkeys.c
+++ b/libsepol/src/ibpkeys.c
@@ -1,5 +1,6 @@
 #include <netinet/in.h>
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include "debug.h"
 #include "context.h"
@@ -176,7 +177,7 @@ int sepol_ibpkey_query(sepol_handle_t *handle,
 	return STATUS_SUCCESS;
 
 err:
-	ERR(handle, "could not query ibpkey subnet prefix: %#lx range %u - %u exists",
+	ERR(handle, "could not query ibpkey subnet prefix: %#" PRIx64 " range %u - %u exists",
 	    subnet_prefix, low, high);
 	return STATUS_ERR;
 }
@@ -203,7 +204,7 @@ int sepol_ibpkey_modify(sepol_handle_t *handle,
 	return STATUS_SUCCESS;
 
 err:
-	ERR(handle, "could not load ibpkey subnet prefix: %#lx range %u - %u exists",
+	ERR(handle, "could not load ibpkey subnet prefix: %#" PRIx64 " range %u - %u exists",
 	    subnet_prefix, low, high);
 	if (ibpkey) {
 		context_destroy(&ibpkey->context[0]);
-- 
2.19.1


             reply	other threads:[~2018-11-05 14:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05 14:38 Stephen Smalley [this message]
2018-11-05 20:55 ` [PATCH] libsepol: ibpkeys.c: fix printf format string specifiers for subnet_prefix Nicolas Iooss
2018-11-23 21:08   ` Nicolas Iooss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181105143838.5198-1-sds@tycho.nsa.gov \
    --to=sds@tycho.nsa.gov \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).