summaryrefslogtreecommitdiff
path: root/src/bootchart/store.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-09-16 18:42:22 +0200
committerTom Gundersen <teg@jklm.no>2014-09-16 18:42:22 +0200
commite10f3c431a3bc1a94fbe9d2a14d3025550f9672e (patch)
tree1a0a06c5c8698c50d8ed04d64b6ae45d6f8b2706 /src/bootchart/store.c
parentcaffbef636ec48958dcb22e4b4140a9889a6a769 (diff)
bootchart: use safe_atod() rather than strtod()
Diffstat (limited to 'src/bootchart/store.c')
-rw-r--r--src/bootchart/store.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bootchart/store.c b/src/bootchart/store.c
index 2d2ea428fa..ed46a503c6 100644
--- a/src/bootchart/store.c
+++ b/src/bootchart/store.c
@@ -251,6 +251,7 @@ schedstat_next:
_cleanup_fclose_ FILE *st = NULL;
char t[32];
struct ps_struct *parent;
+ int r;
ps->next_ps = new0(struct ps_struct, 1);
if (!ps->next_ps) {
@@ -310,7 +311,11 @@ schedstat_next:
if (!sscanf(m, "%*s %*s %s", t))
continue;
- ps->starttime = strtod(t, NULL) / 1000.0;
+ r = safe_atod(t, &ps->starttime);
+ if (r < 0)
+ continue;
+
+ ps->starttime /= 1000.0;
if (arg_show_cgroup)
/* if this fails, that's OK */