You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2021/02/03 23:46:05 UTC

[trafficserver] 10/20: Change atoi to atol, causing obvious issues on what needs to be int64's (#7466)

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 9.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 9b1c40e148ff2f102797ceca5c0f37ed655c5642
Author: Evan Zelkowitz <ez...@apache.org>
AuthorDate: Mon Feb 1 11:41:57 2021 -0700

    Change atoi to atol, causing obvious issues on what needs to be int64's (#7466)
    
    The system stats plugin is currently using atoi and ints. These need to be longs to match int64
---
 plugins/experimental/system_stats/system_stats.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/experimental/system_stats/system_stats.c b/plugins/experimental/system_stats/system_stats.c
index 7f7a42d..f8b5104 100644
--- a/plugins/experimental/system_stats/system_stats.c
+++ b/plugins/experimental/system_stats/system_stats.c
@@ -112,7 +112,7 @@ getFile(const char *filename, char *buffer, int bufferSize)
 }
 
 static void
-statSet(const char *name, int value, TSMutex stat_creation_mutex)
+statSet(const char *name, long value, TSMutex stat_creation_mutex)
 {
   int stat_id = statAdd(name, TS_RECORDDATATYPE_INT, stat_creation_mutex);
   if (stat_id != TS_ERROR) {
@@ -153,7 +153,7 @@ setNetStat(TSMutex stat_creation_mutex, const char *interface, const char *entry
   if (getFile(&sysfs_name[0], &data[0], sizeof(data)) < 0) {
     TSDebug(DEBUG_TAG, "Error reading file %s", sysfs_name);
   } else {
-    statSet(stat_name, atoi(data), stat_creation_mutex);
+    statSet(stat_name, atol(data), stat_creation_mutex);
   }
 }