Module: sip-router
Branch: master
Commit: 8d9b600516a6cafccf7ae06fe30009656abcdf56
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=8d9b600…
Author: Alex Hermann <alex(a)speakup.nl>
Committer: Alex Hermann <alex(a)speakup.nl>
Date: Mon Aug 8 16:11:01 2011 +0200
modules_k/pv: fix 64bit bug.
time_t is a long int on 64bit systems. Do not cast a int* to time_t*.
---
modules_k/pv/pv_trans.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/modules_k/pv/pv_trans.c b/modules_k/pv/pv_trans.c
index 7b7b564..43ff05d 100644
--- a/modules_k/pv/pv_trans.c
+++ b/modules_k/pv/pv_trans.c
@@ -72,7 +72,7 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype,
char *p, *s;
str st, st2;
pv_value_t v, w;
- void *vp;
+ time_t t;
if(val==NULL || (val->flags&PV_VAL_NULL && subtype != TR_S_SQL))
return -1;
@@ -586,9 +586,9 @@ int tr_eval_string(struct sip_msg *msg, tr_param_t *tp, int subtype,
}
memcpy(s, st.s, st.len);
s[st.len] = '\0';
- vp = (void*)&val->ri;
+ t = val->ri;
val->rs.len = strftime(_tr_buffer, TR_BUFFER_SIZE-1, s,
- localtime((time_t*)vp));
+ localtime(&t));
pkg_free(s);
val->flags = PV_VAL_STR;
val->rs.s = _tr_buffer;