Fix: shm-path: handling of snprintf return value
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 18 Sep 2015 18:46:23 +0000 (14:46 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 18 Sep 2015 18:51:24 +0000 (14:51 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/ust-consumer/ust-consumer.c

index d45707b763deaf653b3ed75f65c80a3f5ed42b55..08e6ee0d8f895591c995023ffe1292dc5040b773 100644 (file)
@@ -254,8 +254,8 @@ 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) {
-               ret = -1;
+       if (ret < 0) {
+               PERROR("snprintf");
                goto end;
        }
        strncat(stream_shm_path, cpu_nr,
This page took 0.035263 seconds and 4 git commands to generate.