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 22:01:40 +0000 (18:01 -0400)
commit60b7e1f88a2b7a79c793684ff4cbcd6f38ca406f
treea0b6ef4a44948a84d781a3f61bc8b066006113b0
parentf8e06d39e3e38ea73b0107a812678b136e9e369d
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.03243 seconds and 4 git commands to generate.