提交 3aa5055b authored 作者: Jeff Lenk's avatar Jeff Lenk

windows compiler fixes and switch_mprintf overflow(32bit only)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15286 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 1200a127
......@@ -2083,7 +2083,12 @@ auth_res_t sofia_reg_parse_auth(sofia_profile_t *profile,
char *sql;
x = get_nc(nc, sip);
sql = switch_mprintf("update sip_authentication set expires='%ld',last_nc=%lu where nonce='%s'",
#ifdef _WIN32 && !_WIN64
#define LL_FMT "ll"
#else
#define LL_FMT "l"
#endif
sql = switch_mprintf("update sip_authentication set expires='%"LL_FMT"u',last_nc=%lu where nonce='%s'",
switch_epoch_time_now(NULL) + (profile->nonce_ttl ? profile->nonce_ttl : exptime + 10), x, nonce);
switch_assert(sql != NULL);
......
......@@ -1342,7 +1342,7 @@ SWITCH_DECLARE(int) get_addr_int(switch_sockaddr_t *sa)
{
struct sockaddr_in *s = (struct sockaddr_in *)&sa->sa;
return ntohs(s->sin_addr.s_addr);
return ntohs((unsigned short)s->sin_addr.s_addr);
}
......@@ -1351,7 +1351,7 @@ SWITCH_DECLARE(int) switch_cmp_addr(switch_sockaddr_t *sa1, switch_sockaddr_t *s
struct sockaddr_in *s1 = (struct sockaddr_in *)&sa1->sa;
struct sockaddr_in *s2 = (struct sockaddr_in *)&sa2->sa;
return (ntohs(s1->sin_addr.s_addr) == ntohs(s2->sin_addr.s_addr) && ntohs(s1->sin_port) == ntohs(s2->sin_port));
return (ntohs((unsigned short)s1->sin_addr.s_addr) == ntohs((unsigned short)s2->sin_addr.s_addr) && ntohs(s1->sin_port) == ntohs(s2->sin_port));
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论