diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-26 18:19:12 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-12-26 18:19:12 +0000 |
commit | c5acba479d47d47b0809d2627f22762e77a7669f (patch) | |
tree | 1a9f3f52b9d9fdc502c341ca74ba1231bc98d753 /channels/chan_sip.c | |
parent | 678447e2d0fca85d2879bb94a68fda191f26f2dc (diff) |
cast time_t to an int in printf/scanf (issue #5635)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@7634 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index f1d549b57..10745916e 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1594,7 +1594,7 @@ static void realtime_update_peer(const char *peername, struct sockaddr_in *sin, time_t nowtime; time(&nowtime); nowtime += expirey; - snprintf(regseconds, sizeof(regseconds), "%ld", nowtime); /* Expiration time */ + snprintf(regseconds, sizeof(regseconds), "%d", (int)nowtime); /* Expiration time */ ast_inet_ntoa(ipaddr, sizeof(ipaddr), sin->sin_addr); snprintf(port, sizeof(port), "%d", ntohs(sin->sin_port)); } @@ -12069,7 +12069,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int } if (realtime && !strcasecmp(v->name, "regseconds")) { - if (sscanf(v->value, "%li", ®seconds) != 1) + if (sscanf(v->value, "%i", (int *)®seconds) != 1) regseconds = 0; } else if (realtime && !strcasecmp(v->name, "ipaddr") && !ast_strlen_zero(v->value) ) { inet_aton(v->value, &(peer->addr.sin_addr)); @@ -12232,7 +12232,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, int destroy_association(peer); memset(&peer->addr, 0, sizeof(peer->addr)); if (option_debug) - ast_log(LOG_DEBUG, "Bah, we're expired (%ld/%ld/%ld)!\n", nowtime - regseconds, regseconds, nowtime); + ast_log(LOG_DEBUG, "Bah, we're expired (%d/%d/%d)!\n", (int)(nowtime - regseconds), (int)regseconds, (int)nowtime); } } ast_copy_flags(peer, &peerflags, mask.flags); |