[balsa] Fix some more conversion specifier mismatches



commit b90dfec2411eb7911c33aff70f5d29c48cb5f30f
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Apr 15 16:48:32 2017 -0400

    Fix some more conversion specifier mismatches
    
        * libnetclient/net-client-pop.c (net_client_pop_list): cast gsize
          to unsigned long, to print portably with %lu.
        * libnetclient/net-client.c (net_client_read_line): use
          G_GSIZE_FORMAT to scan portably a POP3 message list.

 ChangeLog                     |    9 +++++++++
 libnetclient/net-client-pop.c |    2 +-
 libnetclient/net-client.c     |    2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c20cad4..c4e9380 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-04-15  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Fix some more conversion specifier mismatches
+
+       * libnetclient/net-client-pop.c (net_client_pop_list): cast gsize
+         to unsigned long, to print portably with %lu.
+       * libnetclient/net-client.c (net_client_read_line): use
+         G_GSIZE_FORMAT to scan portably a POP3 message list.
+
 2017-04-14  Peter Bloomfield  <pbloomfield bellsouth net>
 
        * libbalsa/misc.h: define libbalsa_urlencode and libbalsa_decode
diff --git a/libnetclient/net-client-pop.c b/libnetclient/net-client-pop.c
index 7145276..07f799f 100644
--- a/libnetclient/net-client-pop.c
+++ b/libnetclient/net-client-pop.c
@@ -243,7 +243,7 @@ net_client_pop_list(NetClientPop *client, GList **msg_list, gboolean with_uid, G
 
                                info = g_new0(NetClientPopMessageInfo, 1U);
                                *msg_list = g_list_prepend(*msg_list, info);
-                               if (sscanf(reply, "%u %lu", &info->id, &info->size) != 2) {
+                               if (sscanf(reply, "%u %" G_GSIZE_FORMAT, &info->id, &info->size) != 2) {
                                        result = FALSE;
                                        g_set_error(error, NET_CLIENT_POP_ERROR_QUARK, (gint) 
NET_CLIENT_ERROR_POP_PROTOCOL, _("bad server reply"));
                                }
diff --git a/libnetclient/net-client.c b/libnetclient/net-client.c
index d1738c8..ed58d44 100644
--- a/libnetclient/net-client.c
+++ b/libnetclient/net-client.c
@@ -165,7 +165,7 @@ net_client_read_line(NetClient *client, gchar **recv_line, GError **error)
                        /* check that the protocol-specific maximum line length is not exceeded */
                        if ((client->priv->max_line_len > 0U) && (length > client->priv->max_line_len)) {
                                g_set_error(error, NET_CLIENT_ERROR_QUARK, (gint) 
NET_CLIENT_ERROR_LINE_TOO_LONG,
-                                       _("reply length %lu exceeds the maximum allowed length %lu"), length, 
client->priv->max_line_len);
+                                       _("reply length %lu exceeds the maximum allowed length %lu"), 
(unsigned long) length, (unsigned long) client->priv->max_line_len);
                                g_free(line_buf);
                        } else {
                                g_debug("R '%s'", line_buf);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]