perf symbols: Get rid of duplicated snprintf()
PATCH 1/1 perf symbols: Get rid of duplicated snprintf()
The 'path' is set on a upper line, don't need to do it again.
Signed-off-by Namhyung Kim <[email protected]>
--- tools/perf/util/symbol.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
tools/perf/util/symbol.c +1 -6
@@ -1757,7 +1757,7 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,struct stat st;/*sshfs might return bad dent->d_type, so we have to stat*/ -sprintf (path,"%s/%s" , dir_name, dent->d_name); +snprintf (path,sizeof (path),"%s/%s" , dir_name, dent->d_name);if (stat (path, &st))continue ;
@@ -1766,8 +1766,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg, !strcmp(dent->d_name, ".."))continue ; -snprintf (path,sizeof (path),"%s/%s" , - dir_name, dent->d_name); ret =map_groups__set_modules_path_dir (mg, path);if (ret <0 ) goto out;
@@ -1788,9 +1786,6 @@ static int map_groups__set_modules_path_dir(struct map_groups *mg,if (map ==NULL )continue ; -snprintf (path,sizeof (path),"%s/%s" , - dir_name, dent->d_name); - long_name =strdup (path);if (long_name ==NULL ) { ret =-1 ;
Signature · 1 line
1.7.6