diff options
author | Kevin McCarthy <kevin@8t8.us> | 2015-07-23 14:57:04 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2015-07-23 14:57:04 -0700 |
commit | d1ee38fec1c72878816bb8cc20d63a4dea6a4ca3 (patch) | |
tree | 048e602e21589771d70daa281791fea46be8b5e1 /imap | |
parent | 280e870149dc27eb00eef9ae2004579966cd051f (diff) |
Fix compiler type warnings. (closes #3765)
The output of mutt_local_tz() was being passed to abs(). Technically
the return type is time_t, but it represents a small value: the timezone
offset in seconds. Add a safe explicit cast to int.
Change the txt parameter of mutt_make_help() to type const char *.
Typically all calls run the txt parameter through _(), which
accepts const char * and returns a char *. However, if NLS is not
enabled, _() is a noop, simply returning the parameter itself. In
mutt_compile_help(), items[i].name is const char *, so it will generate
a warning when passed as the txt parameter of mutt_make_help().
On some systems, e.g. OS X, snprintf is defined as a macro. One call
in hcache.c was embedding directives inside the snprintf call. This is
apparently undefined behavior, so duplicate the call instead.
Diffstat (limited to 'imap')
-rw-r--r-- | imap/util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/imap/util.c b/imap/util.c index 6295c5ff..c05465a3 100644 --- a/imap/util.c +++ b/imap/util.c @@ -591,7 +591,7 @@ void imap_make_date (char *buf, time_t timestamp) snprintf (buf, IMAP_DATELEN, "%02d-%s-%d %02d:%02d:%02d %+03d%02d", tm->tm_mday, Months[tm->tm_mon], tm->tm_year + 1900, tm->tm_hour, tm->tm_min, tm->tm_sec, - (int) tz / 60, (int) abs (tz) % 60); + (int) tz / 60, (int) abs ((int) tz) % 60); } /* imap_qualify_path: make an absolute IMAP folder target, given IMAP_MBOX |