aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-26 18:19:12 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2005-12-26 18:19:12 +0000
commitc5acba479d47d47b0809d2627f22762e77a7669f (patch)
tree1a9f3f52b9d9fdc502c341ca74ba1231bc98d753 /pbx
parent678447e2d0fca85d2879bb94a68fda191f26f2dc (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 'pbx')
-rw-r--r--pbx/pbx_dundi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index 15b15845b..b978d28a6 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -1149,7 +1149,7 @@ static int cache_lookup_internal(time_t now, struct dundi_request *req, char *ke
/* 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 @@ static void save_secret(const char *newkey, const char *oldkey)
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 @@ static void load_password(void)
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)