[lttng-dev] [lttng-tool] Fix: wrong casting of return value

Jonathan Rajotte Julien jonathan.r.julien at gmail.com
Mon Jun 9 11:40:36 EDT 2014


The function uri_parse_str_urls return a ssize_t and the return was
casted to a size_t. This caused the following error checking to fail as
-1 was interpreted as 18446744073709551615.

Fixes #803

Signed-off-by: Jonathan Rajotte Julien <jonathan.r.julien at gmail.com>
---
 src/lib/lttng-ctl/save.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lib/lttng-ctl/save.c b/src/lib/lttng-ctl/save.c
index d136b2d..d414a9d 100644
--- a/src/lib/lttng-ctl/save.c
+++ b/src/lib/lttng-ctl/save.c
@@ -99,7 +99,8 @@ int lttng_save_session_attr_set_output_url(
 	struct lttng_save_session_attr *attr, const char *url)
 {
 	int ret = 0;
-	size_t len, size;
+	size_t len;
+	ssize_t size;
 	struct lttng_uri *uris = NULL;
 
 	if (!attr) {
-- 
2.0.0




More information about the lttng-dev mailing list