Skip to content

Commit ab8744e

Browse files
authored
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
1 parent 152c011 commit ab8744e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugins/experimental/system_stats/system_stats.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ getFile(const char *filename, char *buffer, int bufferSize)
112112
}
113113

114114
static void
115-
statSet(const char *name, int value, TSMutex stat_creation_mutex)
115+
statSet(const char *name, long value, TSMutex stat_creation_mutex)
116116
{
117117
int stat_id = statAdd(name, TS_RECORDDATATYPE_INT, stat_creation_mutex);
118118
if (stat_id != TS_ERROR) {
@@ -153,7 +153,7 @@ setNetStat(TSMutex stat_creation_mutex, const char *interface, const char *entry
153153
if (getFile(&sysfs_name[0], &data[0], sizeof(data)) < 0) {
154154
TSDebug(DEBUG_TAG, "Error reading file %s", sysfs_name);
155155
} else {
156-
statSet(stat_name, atoi(data), stat_creation_mutex);
156+
statSet(stat_name, atol(data), stat_creation_mutex);
157157
}
158158
}
159159

0 commit comments

Comments
 (0)