From: David van Moolenbroek Date: Wed, 27 Feb 2013 17:53:27 +0000 (+0000) Subject: sprofalyze: fix profile data parsing X-Git-Tag: v3.3.0~1120 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=2ea6149f7c67a261cf7d9421ca9cf77ee8f7355c;p=minix.git sprofalyze: fix profile data parsing --- diff --git a/commands/sprofalyze/sprofalyze.c b/commands/sprofalyze/sprofalyze.c index 8a61358b9..aabef5c8d 100755 --- a/commands/sprofalyze/sprofalyze.c +++ b/commands/sprofalyze/sprofalyze.c @@ -494,8 +494,9 @@ static void load_trace(const char *path) { } /* check file format and update totals */ - if (fscanf(file, "stat\n%u %u %u\n", - &size_info, &size_sample, &size_proc) != 3) { + if (fscanf(file, "stat\n%u %u %u", + &size_info, &size_sample, &size_proc) != 3 || + fgetc(file) != '\n') { fprintf(stderr, "error: file \"%s\" does not contain an " "sprofile trace\n", path); exit(1);