projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: handle signed return value for snprintf
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
save.c
diff --git
a/src/bin/lttng-sessiond/save.c
b/src/bin/lttng-sessiond/save.c
index 8599d2d18a6796bc3c6ba90017f4ea55420c0d6d..2d8af38217754916ea7080dba0604f479c88027a 100644
(file)
--- a/
src/bin/lttng-sessiond/save.c
+++ b/
src/bin/lttng-sessiond/save.c
@@
-1425,6
+1425,7
@@
int save_session(struct ltt_session *session,
}
strncpy(config_file_path, provided_path, len);
} else {
}
strncpy(config_file_path, provided_path, len);
} else {
+ ssize_t ret_len;
char *home_dir = utils_get_user_home_dir(
LTTNG_SOCK_GET_UID_CRED(creds));
if (!home_dir) {
char *home_dir = utils_get_user_home_dir(
LTTNG_SOCK_GET_UID_CRED(creds));
if (!home_dir) {
@@
-1432,14
+1433,15
@@
int save_session(struct ltt_session *session,
goto end;
}
goto end;
}
- len = snprintf(config_file_path, PATH_MAX,
+
ret_
len = snprintf(config_file_path, PATH_MAX,
DEFAULT_SESSION_HOME_CONFIGPATH, home_dir);
free(home_dir);
DEFAULT_SESSION_HOME_CONFIGPATH, home_dir);
free(home_dir);
- if (len < 0) {
+ if (
ret_
len < 0) {
PERROR("snprintf save session");
ret = LTTNG_ERR_SET_URL;
goto end;
}
PERROR("snprintf save session");
ret = LTTNG_ERR_SET_URL;
goto end;
}
+ len = ret_len;
}
/*
}
/*
This page took
0.024944 seconds
and
5
git commands to generate.