smp: Use correct printf specifier to print SPIs
[strongswan.git] / src / libcharon / plugins / smp / smp.c
index 29d3d2d..ad84818 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));