[sr-dev] git:master: acc(k): Replace call to (deprecated) atoi() function with

Timo Reimann timo.reimann at 1und1.de
Fri Oct 7 19:33:28 CEST 2011


Module: sip-router
Branch: master
Commit: 5a6a30cd341f14ba46e8a1b99e9c4327a2fad495
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5a6a30cd341f14ba46e8a1b99e9c4327a2fad495

Author: Timo Reimann <timo.reimann at 1und1.de>
Committer: Timo Reimann <timo.reimann at 1und1.de>
Date:   Wed Sep 28 00:28:05 2011 +0200

acc(k): Replace call to (deprecated) atoi() function with
strtol().

---

 modules_k/acc/acc_cdr.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules_k/acc/acc_cdr.c b/modules_k/acc/acc_cdr.c
index 7859ea9..ddaedd7 100644
--- a/modules_k/acc/acc_cdr.c
+++ b/modules_k/acc/acc_cdr.c
@@ -237,8 +237,9 @@ static struct timeval time_from_string( str* time_value)
         return time_error;
     }
     
-    return (struct timeval) { atoi( zero_terminated_value),
-                            atoi( dot_address + 1)};
+    time_res->tv_sec = strtol( zero_terminated_value, (char **)NULL, 10);
+    time_res->tv_usec = strtol( dot_address + 1, (char **)NULL, 10);
+    return 0;
 }
 
 /* set the duration in the dialog struct */




More information about the sr-dev mailing list