diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-09-27 22:25:07 +0200 |
---|---|---|
committer | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-09-28 14:46:38 +0200 |
commit | e931d3f4241231e4102eda06adaf7cbfd68c6a5d (patch) | |
tree | 7ff5eb21ee1bea1ed260726164f70a10e528027c /src/bootchart/svg.c | |
parent | 9bcf7507fab6e6b022ae3cc7178237e6e0a09e9a (diff) |
bootchart: check return of strftime
Found by coverity. Fixes: CID#996314 and #996312
Diffstat (limited to 'src/bootchart/svg.c')
-rw-r--r-- | src/bootchart/svg.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c index 135883fb83..faf377e506 100644 --- a/src/bootchart/svg.c +++ b/src/bootchart/svg.c @@ -162,7 +162,7 @@ static void svg_title(const char *build) { char *c; FILE *f; time_t t; - int fd; + int fd, r; struct utsname uts; /* grab /proc/cmdline */ @@ -196,7 +196,8 @@ static void svg_title(const char *build) { /* date */ t = time(NULL); - strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", localtime(&t)); + r = strftime(date, sizeof(date), "%a, %d %b %Y %H:%M:%S %z", localtime(&t)); + assert_se(r > 0); /* CPU type */ fd = openat(procfd, "cpuinfo", O_RDONLY); |