From d59751e19f7351c0e454094ea73b9fa6b107cd99 Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Sun, 27 Mar 2011 20:42:18 +0200 Subject: [PATCH] Fix a few warnings with gcc 4.4.5 --- src/mail.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mail.cc b/src/mail.cc index 1f331a20..6786f9f4 100644 --- a/src/mail.cc +++ b/src/mail.cc @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -122,7 +123,7 @@ namespace { hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; - snprintf(portbuf, 8, "%lu", get()); + snprintf(portbuf, 8, "%" SCNu16, get()); if(int res = getaddrinfo(get().c_str(), portbuf, &hints, &ai)) throw std::runtime_error(std::string("IMAP getaddrinfo: ") + gai_strerror(res)); @@ -551,7 +552,7 @@ std::unique_ptr parse_mail_args(mail_type type, const char *arg) tmp = (char*)strstr(arg, "-r "); if (tmp) { tmp += 3; - sscanf(tmp, "%u", &mail->retries); + sscanf(tmp, "%" SCNu16, &mail->retries); } else { mail->retries = 5; // 5 retries after failure } @@ -567,7 +568,7 @@ std::unique_ptr parse_mail_args(mail_type type, const char *arg) tmp = (char*)strstr(arg, "-p "); if (tmp) { tmp += 3; - sscanf(tmp, "%lu", &get(*mail)); + sscanf(tmp, "%" SCNu16, &get(*mail)); } else { if (type == POP3_TYPE) { get(*mail) = 110; // default pop3 port