Skip to content

Commit

Permalink
Fix coverity error 1386593: printf_arg_mismatch
Browse files Browse the repository at this point in the history
As "my_timezone" is of type "long int", we should use
"labs" instead of "abs" which will then also match
the %ld formatstring.
  • Loading branch information
pstorz committed Dec 15, 2016
1 parent 538c4e5 commit d5512bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/bsmtp.c
Expand Up @@ -242,7 +242,7 @@ static void get_date_string(char *buf, int buf_len)

my_timezone = tz_offset(now, tm);
strftime(buf, buf_len, "%a, %d %b %Y %H:%M:%S", &tm);
snprintf(tzbuf, sizeof(tzbuf), " %+2.2ld%2.2ld", -my_timezone / 60, abs(my_timezone) % 60);
snprintf(tzbuf, sizeof(tzbuf), " %+2.2ld%2.2ld", -my_timezone / 60, labs(my_timezone) % 60);
strcat(buf, tzbuf); /* add +0100 */
strftime(tzbuf, sizeof(tzbuf), " (%Z)", &tm);
strcat(buf, tzbuf); /* add (CEST) */
Expand Down

0 comments on commit d5512bc

Please sign in to comment.