Fix: shm-path: handling of snprintf return value
[lttng-tools.git] / 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.024104 seconds and 4 git commands to generate.