Skip to content
Snippets Groups Projects
Commit 0ba209d2 authored by Harout Hedeshian's avatar Harout Hedeshian
Browse files

datatop: fix file line count helper function always returns 0 lines

When porting the snapshot, a change was made to
dtop_get_file_line_amount() to initialize rc to -1. glibc defines
EoF as -1 thus causing the for loop to never get executed. A line count
of 0 was getting returnd thus causing ~1500 data points to not get
polled. Instead, initialize rc to 0.

Change-Id: I8e7a93f5efd535d662c13fa81cd5d0e421ad5a6b
parent 0abce006
No related branches found
No related tags found
No related merge requests found
......@@ -153,7 +153,7 @@ void dtop_close_file(FILE *fw)
*/
int dtop_get_file_line_amount(char *name)
{
signed char rc = -1;
signed char rc = 0;
int line_count = 0;
FILE *file = fopen(name, "r");
while (rc != EOF) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment