[libnetfilter_conntrack] snprintf: fix compilation warning in 64-bits platforms

Pablo Neira netfilter-cvslog-bounces at lists.netfilter.org
Thu Oct 30 16:19:54 CET 2008


Gitweb:		http://git.netfilter.org/cgi-bin/gitweb.cgi?p=libnetfilter_conntrack.git;a=commit;h=215d42fef86577ad74151cda553a20b1bdb58a30
commit 215d42fef86577ad74151cda553a20b1bdb58a30
Author:     Pablo Neira Ayuso <pablo at netfilter.org>
AuthorDate: Thu Oct 30 16:17:52 2008 +0100
Commit:     Pablo Neira Ayuso <pablo at netfilter.org>
CommitDate: Thu Oct 30 16:17:52 2008 +0100

    snprintf: fix compilation warning in 64-bits platforms
    
    We have to cast the counters to unsigned long long to fix
    a compilation warning in 64-bits platforms.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
       via  215d42fef86577ad74151cda553a20b1bdb58a30 (commit)
      from  83ee97498db28cb3e092f26f1a9169fbff1b1c6e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 215d42fef86577ad74151cda553a20b1bdb58a30
Author: Pablo Neira Ayuso <pablo at netfilter.org>
Date:   Thu Oct 30 16:17:52 2008 +0100

    snprintf: fix compilation warning in 64-bits platforms
    
    We have to cast the counters to unsigned long long to fix
    a compilation warning in 64-bits platforms.
    
    Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

-----------------------------------------------------------------------

 src/conntrack/snprintf_xml.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
We have to cast the counters to unsigned long long to fix
a compilation warning in 64-bits platforms.

Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>

diff --git a/src/conntrack/snprintf_xml.c b/src/conntrack/snprintf_xml.c
index 9cd49cf..b14ff43 100644
--- a/src/conntrack/snprintf_xml.c
+++ b/src/conntrack/snprintf_xml.c
@@ -191,11 +191,11 @@ static int __snprintf_counters_xml(char *buf,
 	unsigned int size = 0, offset = 0;
 
 	ret = snprintf(buf, len, "<packets>%llu</packets>",
-		       ct->counters[type].packets);
+		       (unsigned long long)ct->counters[type].packets);
 	BUFFER_SIZE(ret, size, len, offset);
 
 	ret = snprintf(buf+offset, len, "<bytes>%llu</bytes>",
-		       ct->counters[type].bytes);
+		       (unsigned long long)ct->counters[type].bytes);
 	BUFFER_SIZE(ret, size, len, offset);
 
 	return size;



More information about the netfilter-cvslog mailing list