Skip to contentSkip to conversation

Fix: shm-path: handling of snprintf return value

PATCH Jérémie Galarneau 1 participant 1 message Sep 21, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Merged in master and stable-2.7.

Thanks!
Jérémie

Quoted 21 lines · Mathieu Desnoyers
---
 src/common/ust-consumer/ust-consumer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/common/ust-consumer/ust-consumer.c +1 -2
index d45707b..a342f97 100644
@@ -254,7 +254,7 @@ int get_stream_shm_path(char *stream_shm_path, const char *shm_path, int cpu)
        strncpy(stream_shm_path, shm_path, PATH_MAX);
        stream_shm_path[PATH_MAX - 1] = '\0';
        ret = snprintf(cpu_nr, UINT_MAX_STR_LEN, "%u", cpu);
-       if (ret != 1) {
+       if (ret < 0) {
                ret = -1;
                goto end;
        }
--

2.1.4

Signature · 8 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev