[asterisk-commits] trunk - r7635 in /trunk: ./ apps/ channels/ pbx/
res/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Mon Dec 26 12:35:35 CST 2005
Author: russell
Date: Mon Dec 26 12:35:28 2005
New Revision: 7635
URL: http://svn.digium.com/view/asterisk?rev=7635&view=rev
Log:
Merged revisions 7634 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r7634 | russell | 2005-12-26 13:19:12 -0500 (Mon, 26 Dec 2005) | 2 lines
cast time_t to an int in printf/scanf (issue #5635)
........
Modified:
trunk/ (props changed)
trunk/apps/app_chanspy.c
trunk/apps/app_externalivr.c
trunk/apps/app_queue.c
trunk/apps/app_sms.c
trunk/asterisk.c
trunk/channels/chan_agent.c
trunk/channels/chan_iax2.c
trunk/channels/chan_sip.c
trunk/cli.c
trunk/config.c
trunk/pbx/pbx_dundi.c
trunk/res/res_monitor.c
Propchange: trunk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon Dec 26 12:35:28 2005
@@ -1,1 +1,1 @@
-/branches/1.2:1-7489,7491-7496,7498-7516,7518-7528,7530-7545,7547-7549,7551,7553-7556,7558-7579,7581-7585,7587-7594,7596-7604,7606,7608
+/branches/1.2:1-7489,7491-7496,7498-7516,7518-7528,7530-7545,7547-7549,7551,7553-7556,7558-7579,7581-7585,7587-7594,7596-7604,7606-7634
Modified: trunk/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_chanspy.c?rev=7635&r1=7634&r2=7635&view=diff
==============================================================================
--- trunk/apps/app_chanspy.c (original)
+++ trunk/apps/app_chanspy.c Mon Dec 26 12:35:28 2005
@@ -439,7 +439,7 @@
if (recbase) {
char filename[512];
- snprintf(filename,sizeof(filename),"%s/%s.%ld.raw",ast_config_AST_MONITOR_DIR, recbase, time(NULL));
+ snprintf(filename,sizeof(filename),"%s/%s.%d.raw",ast_config_AST_MONITOR_DIR, recbase, (int)time(NULL));
if ((fd = open(filename, O_CREAT | O_WRONLY, O_TRUNC)) <= 0) {
ast_log(LOG_WARNING, "Cannot open %s for recording\n", filename);
fd = 0;
Modified: trunk/apps/app_externalivr.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_externalivr.c?rev=7635&r1=7634&r2=7635&view=diff
==============================================================================
--- trunk/apps/app_externalivr.c (original)
+++ trunk/apps/app_externalivr.c Mon Dec 26 12:35:28 2005
@@ -94,9 +94,9 @@
char tmp[256];
if (!data) {
- snprintf(tmp, sizeof(tmp), "%c,%10ld", event, time(NULL));
+ snprintf(tmp, sizeof(tmp), "%c,%10d", event, (int)time(NULL));
} else {
- snprintf(tmp, sizeof(tmp), "%c,%10ld,%s", event, time(NULL), data);
+ snprintf(tmp, sizeof(tmp), "%c,%10d,%s", event, (int)time(NULL), data);
}
fprintf(handle, "%s\n", tmp);
Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?rev=7635&r1=7634&r2=7635&view=diff
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Mon Dec 26 12:35:28 2005
@@ -484,11 +484,11 @@
"Membership: %s\r\n"
"Penalty: %d\r\n"
"CallsTaken: %d\r\n"
- "LastCall: %ld\r\n"
+ "LastCall: %d\r\n"
"Status: %d\r\n"
"Paused: %d\r\n",
q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
- cur->penalty, cur->calls, cur->lastcall, cur->status, cur->paused);
+ cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
}
}
}
@@ -1262,11 +1262,11 @@
"Membership: %s\r\n"
"Penalty: %d\r\n"
"CallsTaken: %d\r\n"
- "LastCall: %ld\r\n"
+ "LastCall: %d\r\n"
"Status: %d\r\n"
"Paused: %d\r\n",
q->name, cur->interface, cur->dynamic ? "dynamic" : "static",
- cur->penalty, cur->calls, cur->lastcall, cur->status, cur->paused);
+ cur->penalty, cur->calls, (int)cur->lastcall, cur->status, cur->paused);
}
break;
}
@@ -2421,11 +2421,11 @@
"Membership: %s\r\n"
"Penalty: %d\r\n"
"CallsTaken: %d\r\n"
- "LastCall: %ld\r\n"
+ "LastCall: %d\r\n"
"Status: %d\r\n"
"Paused: %d\r\n",
q->name, new_member->interface, new_member->dynamic ? "dynamic" : "static",
- new_member->penalty, new_member->calls, new_member->lastcall, new_member->status, new_member->paused);
+ new_member->penalty, new_member->calls, (int)new_member->lastcall, new_member->status, new_member->paused);
if (dump)
dump_queue_members(q);
@@ -3435,13 +3435,13 @@
"Membership: %s\r\n"
"Penalty: %d\r\n"
"CallsTaken: %d\r\n"
- "LastCall: %ld\r\n"
+ "LastCall: %d\r\n"
"Status: %d\r\n"
"Paused: %d\r\n"
"%s"
"\r\n",
q->name, mem->interface, mem->dynamic ? "dynamic" : "static",
- mem->penalty, mem->calls, mem->lastcall, mem->status, mem->paused, idText);
+ mem->penalty, mem->calls, (int)mem->lastcall, mem->status, mem->paused, idText);
}
}
/* List Queue Entries */
Modified: trunk/apps/app_sms.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_sms.c?rev=7635&r1=7634&r2=7635&view=diff
==============================================================================
--- trunk/apps/app_sms.c (original)
+++ trunk/apps/app_sms.c Mon Dec 26 12:35:28 2005
@@ -694,7 +694,7 @@
}
while (fgets (line, sizeof (line), s))
{ /* process line in file */
- char *p;
+ unsigned char *p;
for (p = line; *p && *p != '\n' && *p != '\r'; p++);
*p = 0; /* strip eoln */
p = line;
@@ -1379,8 +1379,8 @@
ast_copy_string (h.cli, chan->cid.cid_num, sizeof (h.cli));
{
- char *d = data,
- *p,
+ unsigned char *p;
+ unsigned char *d = data,
answer = 0;
if (!*d || *d == '|') {
ast_log (LOG_ERROR, "Requires queue name\n");
@@ -1449,7 +1449,7 @@
d = p;
h.udl = 0;
while (*p && h.udl < SMSLEN)
- h.ud[h.udl++] = utf8decode((unsigned char **)&p);
+ h.ud[h.udl++] = utf8decode(&p);
if (is7bit (h.dcs) && packsms7 (0, h.udhl, h.udh, h.udl, h.ud) < 0)
ast_log (LOG_WARNING, "Invalid 7 bit GSM data\n");
if (is8bit (h.dcs) && packsms8 (0, h.udhl, h.udh, h.udl, h.ud) < 0)
Modified: trunk/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/asterisk.c?rev=7635&r1=7634&r2=7635&view=diff
==============================================================================
--- trunk/asterisk.c (original)
+++ trunk/asterisk.c Mon Dec 26 12:35:28 2005
@@ -670,8 +670,10 @@
ast_log(LOG_WARNING, "Unable to change ownership of %s: %s\n", ast_config_AST_SOCKET, strerror(errno));
if (!ast_strlen_zero(ast_config_AST_CTL_PERMISSIONS)) {
+ int p1;
mode_t p;
- sscanf(ast_config_AST_CTL_PERMISSIONS, "%o", (int *) &p);
+ sscanf(ast_config_AST_CTL_PERMISSIONS, "%o", &p1);
+ p = p1;
if ((chmod(ast_config_AST_SOCKET, p)) < 0)
ast_log(LOG_WARNING, "Unable to change file permissions of %s: %s\n", ast_config_AST_SOCKET, strerror(errno));
}
@@ -1318,7 +1320,7 @@
if (*t == '%') {
char hostname[MAXHOSTNAMELEN]="";
int i;
- struct timeval tv;
+ time_t ts;
struct tm tm;
#ifdef linux
FILE *LOADAVG;
@@ -1346,8 +1348,8 @@
break;
case 'd': /* date */
memset(&tm, 0, sizeof(struct tm));
- tv = ast_tvnow();
- if (localtime_r(&(tv.tv_sec), &tm)) {
+ time(&ts);
+ if (localtime_r(&ts, &tm)) {
strftime(p, sizeof(prompt) - strlen(prompt), "%Y-%m-%d", &tm);
}
break;
@@ -1403,8 +1405,8 @@
#endif
case 't': /* time */
memset(&tm, 0, sizeof(struct tm));
- tv = ast_tvnow();
- if (localtime_r(&(tv.tv_sec), &tm)) {
+ time(&ts);
+ if (localtime_r(&ts, &tm)) {
strftime(p, sizeof(prompt) - strlen(prompt), "%H:%M:%S", &tm);
}
break;
Modified: trunk/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_agent.c?rev=7635&r1=7634&r2=7635&view=diff
==============================================================================
--- trunk/channels/chan_agent.c (original)
+++ trunk/channels/chan_agent.c Mon Dec 26 12:35:28 2005
@@ -1445,11 +1445,11 @@
"Name: %s\r\n"
"Status: %s\r\n"
"LoggedInChan: %s\r\n"
- "LoggedInTime: %ld\r\n"
+ "LoggedInTime: %d\r\n"
"TalkingTo: %s\r\n"
"%s"
"\r\n",
- p->agent, username, status, loginChan, p->loginstart, talkingtoChan, idText);
+ p->agent, username, status, loginChan, (int)p->loginstart, talkingtoChan, idText);
ast_mutex_unlock(&p->lock);
p = p->next;
}
Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?rev=7635&r1=7634&r2=7635&view=diff
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Mon Dec 26 12:35:28 2005
@@ -2599,7 +2599,7 @@
break;
}
} else if (!strcasecmp(tmp->name, "regseconds")) {
- if (sscanf(tmp->value, "%li", ®seconds) != 1)
+ if (sscanf(tmp->value, "%i", (int *)®seconds) != 1)
regseconds = 0;
} else if (!strcasecmp(tmp->name, "ipaddr")) {
inet_aton(tmp->value, &(peer->addr.sin_addr));
@@ -2638,13 +2638,13 @@
if ((nowtime - regseconds) > IAX_DEFAULT_REG_EXPIRE) {
memset(&peer->addr, 0, sizeof(peer->addr));
if (option_debug)
- ast_log(LOG_DEBUG, "realtime_peer: Bah, '%s' is expired (%ld/%ld/%ld)!\n",
- peername, nowtime - regseconds, regseconds, nowtime);
+ ast_log(LOG_DEBUG, "realtime_peer: Bah, '%s' is expired (%d/%d/%d)!\n",
+ peername, (int)(nowtime - regseconds), (int)regseconds, (int)nowtime);
}
else {
if (option_debug)
- ast_log(LOG_DEBUG, "realtime_peer: Registration for '%s' still active (%ld/%ld/%ld)!\n",
- peername, nowtime - regseconds, regseconds, nowtime);
+ ast_log(LOG_DEBUG, "realtime_peer: Registration for '%s' still active (%d/%d/%d)!\n",
+ peername, (int)(nowtime - regseconds), (int)regseconds, (int)nowtime);
}
}
@@ -2700,7 +2700,7 @@
time_t nowtime;
time(&nowtime);
- snprintf(regseconds, sizeof(regseconds), "%ld", nowtime);
+ snprintf(regseconds, sizeof(regseconds), "%d", (int)nowtime);
ast_inet_ntoa(ipaddr, sizeof(ipaddr), sin->sin_addr);
snprintf(port, sizeof(port), "%d", ntohs(sin->sin_port));
ast_update_realtime("iaxpeers", "name", peername, "ipaddr", ipaddr, "port", port, "regseconds", regseconds, NULL);
@@ -4285,7 +4285,7 @@
#if !defined(__FreeBSD__)
#define FORMAT "%-15.15s %-15d %-15d\n"
#else /* __FreeBSD__ */
-#define FORMAT "%-15.15s %-15d %-15ld\n"
+#define FORMAT "%-15.15s %-15d %-15d\n" /* XXX 2.95 ? */
#endif /* __FreeBSD__ */
struct iax_firmware *cur;
if ((argc != 3) && (argc != 4))
@@ -4296,7 +4296,7 @@
for (cur = waresl.wares;cur;cur = cur->next) {
if ((argc == 3) || (!strcasecmp(argv[3], (char *)cur->fwh->devname)))
ast_cli(fd, FORMAT, cur->fwh->devname, ntohs(cur->fwh->version),
- ntohl(cur->fwh->datalen));
+ (int)ntohl(cur->fwh->datalen));
}
ast_mutex_unlock(&waresl.lock);
return RESULT_SUCCESS;
Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=7635&r1=7634&r2=7635&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Dec 26 12:35:28 2005
@@ -1598,7 +1598,7 @@
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));
}
@@ -12058,7 +12058,7 @@
}
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));
@@ -12221,7 +12221,7 @@
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);
Modified: trunk/cli.c
URL: http://svn.digium.com/view/asterisk/trunk/cli.c?rev=7635&r1=7634&r2=7635&view=diff
==============================================================================
--- trunk/cli.c (original)
+++ trunk/cli.c Mon Dec 26 12:35:28 2005
@@ -368,7 +368,7 @@
if (ast_startuptime) {
tmptime = curtime - ast_startuptime;
if (printsec) {
- ast_cli(fd, "System uptime: %lu\n",tmptime);
+ ast_cli(fd, "System uptime: %lu\n",(u_long)tmptime);
} else {
timestr = format_uptimestr(tmptime);
if (timestr) {
@@ -380,7 +380,7 @@
if (ast_lastreloadtime) {
tmptime = curtime - ast_lastreloadtime;
if (printsec) {
- ast_cli(fd, "Last reload: %lu\n", tmptime);
+ ast_cli(fd, "Last reload: %lu\n", (u_long) tmptime);
} else {
timestr = format_uptimestr(tmptime);
if ((timestr) && (!printsec)) {
Modified: trunk/config.c
URL: http://svn.digium.com/view/asterisk/trunk/config.c?rev=7635&r1=7634&r2=7635&view=diff
==============================================================================
--- trunk/config.c (original)
+++ trunk/config.c Mon Dec 26 12:35:28 2005
@@ -470,7 +470,7 @@
/* #exec </path/to/executable>
We create a tmp file, then we #include it, then we delete it. */
if (do_exec) {
- snprintf(exec_file, sizeof(exec_file), "/var/tmp/exec.%ld.%ld", time(NULL), (long)pthread_self());
+ snprintf(exec_file, sizeof(exec_file), "/var/tmp/exec.%d.%ld", (int)time(NULL), (long)pthread_self());
snprintf(cmd, sizeof(cmd), "%s > %s 2>&1", cur, exec_file);
ast_safe_system(cmd);
cur = exec_file;
Modified: trunk/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_dundi.c?rev=7635&r1=7634&r2=7635&view=diff
==============================================================================
--- trunk/pbx/pbx_dundi.c (original)
+++ trunk/pbx/pbx_dundi.c Mon Dec 26 12:35:28 2005
@@ -1149,7 +1149,7 @@
/* Build request string */
if (!ast_db_get("dundi/cache", key, data, sizeof(data))) {
ptr = data;
- if (sscanf(ptr, "%ld|%n", &timeout, &length) == 1) {
+ if (sscanf(ptr, "%d|%n", (int *)&timeout, &length) == 1) {
expiration = timeout - now;
if (expiration > 0) {
ast_log(LOG_DEBUG, "Found cache expiring in %d seconds!\n", (int)(timeout - now));
@@ -2032,7 +2032,7 @@
snprintf(tmp, sizeof(tmp), "%s", newkey);
rotatetime = time(NULL) + DUNDI_SECRET_TIME;
ast_db_put(secretpath, "secret", tmp);
- snprintf(tmp, sizeof(tmp), "%ld", rotatetime);
+ snprintf(tmp, sizeof(tmp), "%d", (int)rotatetime);
ast_db_put(secretpath, "secretexpiry", tmp);
}
@@ -2044,7 +2044,7 @@
time_t expired;
ast_db_get(secretpath, "secretexpiry", tmp, sizeof(tmp));
- if (sscanf(tmp, "%ld", &expired) == 1) {
+ if (sscanf(tmp, "%d", (int *)&expired) == 1) {
ast_db_get(secretpath, "secret", tmp, sizeof(tmp));
current = strchr(tmp, ';');
if (!current)
Modified: trunk/res/res_monitor.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_monitor.c?rev=7635&r1=7634&r2=7635&view=diff
==============================================================================
--- trunk/res/res_monitor.c (original)
+++ trunk/res/res_monitor.c Mon Dec 26 12:35:28 2005
@@ -150,8 +150,8 @@
while((p = strchr(channel_name, '/'))) {
*p = '-';
}
- snprintf(monitor->filename_base, FILENAME_MAX, "%s/%ld-%s",
- ast_config_AST_MONITOR_DIR, time(NULL),channel_name);
+ snprintf(monitor->filename_base, FILENAME_MAX, "%s/%d-%s",
+ ast_config_AST_MONITOR_DIR, (int)time(NULL),channel_name);
monitor->filename_changed = 1;
} else {
ast_log(LOG_ERROR,"Failed to allocate Memory\n");
More information about the asterisk-commits
mailing list