Browse Source

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

Timo Reimann 14 năm trước cách đây
mục cha
commit
5a6a30cd34
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      modules_k/acc/acc_cdr.c

+ 3 - 2
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 */