Fix: relayd: cast idigit argument to unsigned char
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 25 Mar 2020 22:39:48 +0000 (18:39 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 26 Mar 2020 23:07:45 +0000 (19:07 -0400)
commit4385b61cf515beab90337bb228e61b8c8843a9ce
treea0b6ef4a44948a84d781a3f61bc8b066006113b0
parentaf8cf5596d8ed3781e662d199ab94ae45976a61b
Fix: relayd: cast idigit argument to unsigned char

This diagnostic is emitted when building on cygwin:

    main.c:233:34: warning: array subscript has type ‘char’ [-Wchar-subscripts]
      233 |    if (errno != 0 || !isdigit(arg[0])) {
          |                               ~~~^~~

This is due to passing a `char` argument to isdigit.  According to the
man page of isdigit, the arguments of type `char` must be cast to
`unsigned char`, so they are able to represent the EOF value.  This
patch does that, and should get rid of the warning.

Change-Id: Iaed4c0b494a79b917761e65f18388f43478b97e1
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/main.c
This page took 0.025503 seconds and 4 git commands to generate.