[PATCH weston v2] logind-util: Use %lu for unsigned int in snprintf

Marek Chalupa mchqwerty at gmail.com
Wed Jul 15 04:28:58 PDT 2015


Reviewed-by: Marek Chalupa <mchqwerty at gmail.com>

On Sat, Jul 11, 2015 at 4:51 AM, Bryce Harrington <bryce at osg.samsung.com>
wrote:

> Addresses this warning found by Denis Denisov:
>
>   [src/logind-util.c:702]: (warning) %d in format string (no. 1)
>   requires 'int' but the argument type is 'unsigned int'.
>
> Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
> ---
>  src/logind-util.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/logind-util.c b/src/logind-util.c
> index 5c95874..8ac7e52 100644
> --- a/src/logind-util.c
> +++ b/src/logind-util.c
> @@ -702,7 +702,7 @@ weston_logind_setup_vt(struct weston_logind *wl)
>         sigset_t mask;
>         struct wl_event_loop *loop;
>
> -       snprintf(buf, sizeof(buf), "/dev/tty%d", wl->vtnr);
> +       snprintf(buf, sizeof(buf), "/dev/tty%lu", (unsigned long)wl->vtnr);
>         buf[sizeof(buf) - 1] = 0;
>
>         wl->vt = open(buf, O_RDWR|O_CLOEXEC|O_NONBLOCK);
> --
> 1.9.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150715/cd5844f4/attachment.html>


More information about the wayland-devel mailing list