aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSihyeon Jang <[email protected]>2018-12-02 00:46:03 +0900
committerArnaldo Carvalho de Melo <[email protected]>2018-12-17 14:59:40 -0300
commit75c375c0ae7cc75cec6683ee2539937c60c3e4af (patch)
treeb8f531a3d9cec5c2a89629e0c964691703ccda5d
parentc8dd6ee51a4d0a119c8b4121d83008215e3209ed (diff)
perf config: Modify size factor of snprintf
According to definition of snprintf, it gets size factor including null('\0') byte. So '-1' is not neccessary. Also it will be helpful unfied style with other cases. (eg. builtin-script.c) Signed-off-by: Sihyeon Jang <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/util/config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index 3beb4cf44c31..1ea8f898f1a1 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -815,14 +815,14 @@ int config_error_nonbool(const char *var)
void set_buildid_dir(const char *dir)
{
if (dir)
- scnprintf(buildid_dir, MAXPATHLEN-1, "%s", dir);
+ scnprintf(buildid_dir, MAXPATHLEN, "%s", dir);
/* default to $HOME/.debug */
if (buildid_dir[0] == '\0') {
char *home = getenv("HOME");
if (home) {
- snprintf(buildid_dir, MAXPATHLEN-1, "%s/%s",
+ snprintf(buildid_dir, MAXPATHLEN, "%s/%s",
home, DEBUG_CACHE_DIR);
} else {
strncpy(buildid_dir, DEBUG_CACHE_DIR, MAXPATHLEN-1);