* [lttng-dev] [PATCH lttng-tools] Fix: int printed as uint
@ 2015-09-21 19:19 Michael Jeanson
2015-09-21 20:15 ` Jérémie Galarneau
0 siblings, 1 reply; 2+ messages in thread
From: Michael Jeanson @ 2015-09-21 19:19 UTC (permalink / raw)
Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
---
src/common/ust-consumer/ust-consumer.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c
index 08e6ee0..481bbeb 100644
--- a/src/common/ust-consumer/ust-consumer.c
+++ b/src/common/ust-consumer/ust-consumer.c
@@ -47,7 +47,7 @@
#include "ust-consumer.h"
-#define UINT_MAX_STR_LEN 11 /* includes \0 */
+#define INT_MAX_STR_LEN 12 /* includes \0 */
extern struct lttng_consumer_global_data consumer_data;
extern int consumer_poll_timeout;
@@ -248,12 +248,12 @@ error:
static
int get_stream_shm_path(char *stream_shm_path, const char *shm_path, int cpu)
{
- char cpu_nr[UINT_MAX_STR_LEN]; /* unsigned int max len */
+ char cpu_nr[INT_MAX_STR_LEN]; /* int max len */
int ret;
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);
+ ret = snprintf(cpu_nr, INT_MAX_STR_LEN, "%i", cpu);
if (ret < 0) {
PERROR("snprintf");
goto end;
--
1.9.1
^ permalink raw reply [flat|nested] 2+ messages in thread* [lttng-dev] [PATCH lttng-tools] Fix: int printed as uint
2015-09-21 19:19 [lttng-dev] [PATCH lttng-tools] Fix: int printed as uint Michael Jeanson
@ 2015-09-21 20:15 ` Jérémie Galarneau
0 siblings, 0 replies; 2+ messages in thread
From: Jérémie Galarneau @ 2015-09-21 20:15 UTC (permalink / raw)
Merged in master and stable-2.7.
Thanks!
J?r?mie
On Mon, Sep 21, 2015 at 3:19 PM, Michael Jeanson <mjeanson at efficios.com> wrote:
> Signed-off-by: Michael Jeanson <mjeanson at efficios.com>
> ---
> src/common/ust-consumer/ust-consumer.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c
> index 08e6ee0..481bbeb 100644
> --- a/src/common/ust-consumer/ust-consumer.c
> +++ b/src/common/ust-consumer/ust-consumer.c
> @@ -47,7 +47,7 @@
>
> #include "ust-consumer.h"
>
> -#define UINT_MAX_STR_LEN 11 /* includes \0 */
> +#define INT_MAX_STR_LEN 12 /* includes \0 */
>
> extern struct lttng_consumer_global_data consumer_data;
> extern int consumer_poll_timeout;
> @@ -248,12 +248,12 @@ error:
> static
> int get_stream_shm_path(char *stream_shm_path, const char *shm_path, int cpu)
> {
> - char cpu_nr[UINT_MAX_STR_LEN]; /* unsigned int max len */
> + char cpu_nr[INT_MAX_STR_LEN]; /* int max len */
> int ret;
>
> 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);
> + ret = snprintf(cpu_nr, INT_MAX_STR_LEN, "%i", cpu);
> if (ret < 0) {
> PERROR("snprintf");
> goto end;
> --
> 1.9.1
>
--
J?r?mie Galarneau
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-09-21 20:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-21 19:19 [lttng-dev] [PATCH lttng-tools] Fix: int printed as uint Michael Jeanson
2015-09-21 20:15 ` Jérémie Galarneau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox