]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
smp: Use correct printf specifier to print SPIs
authorTobias Brunner <tobias@strongswan.org>
Tue, 7 May 2019 12:50:11 +0000 (14:50 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 8 May 2019 12:48:54 +0000 (14:48 +0200)
src/libcharon/plugins/smp/smp.c

index 29d3d2dadaf07dadd21008abfbd58e02152e84fb..ad848182c7ccc9164547ef392f717c76a7b10d7d 100644 (file)
@@ -24,6 +24,7 @@
 #include <unistd.h>
 #include <errno.h>
 #include <signal.h>
+#include <inttypes.h>
 #include <libxml/xmlreader.h>
 #include <libxml/xmlwriter.h>
 
@@ -229,7 +230,7 @@ static void request_query_ikesa(xmlTextReaderPtr reader, xmlTextWriterPtr writer
                /* <local> */
                local = ike_sa->get_my_host(ike_sa);
                xmlTextWriterStartElement(writer, "local");
-               xmlTextWriterWriteFormatElement(writer, "spi", "%.16llx",
+               xmlTextWriterWriteFormatElement(writer, "spi", "%.16"PRIx64,
                                        be64toh(id->is_initiator(id) ? id->get_initiator_spi(id)
                                                                                                 : id->get_responder_spi(id)));
                write_id(writer, "identification", ike_sa->get_my_id(ike_sa));
@@ -246,7 +247,7 @@ static void request_query_ikesa(xmlTextReaderPtr reader, xmlTextWriterPtr writer
                /* <remote> */
                remote = ike_sa->get_other_host(ike_sa);
                xmlTextWriterStartElement(writer, "remote");
-               xmlTextWriterWriteFormatElement(writer, "spi", "%.16llx",
+               xmlTextWriterWriteFormatElement(writer, "spi", "%.16"PRIx64,
                                        be64toh(id->is_initiator(id) ? id->get_responder_spi(id)
                                                                                                 : id->get_initiator_spi(id)));
                write_id(writer, "identification", ike_sa->get_other_id(ike_sa));