logind-util: Use %u for unsigned int in snprintf
authorBryce Harrington <bryce@osg.samsung.com>
Sat, 11 Jul 2015 02:51:52 +0000 (19:51 -0700)
committerBryce Harrington <bryce@osg.samsung.com>
Fri, 17 Jul 2015 21:35:50 +0000 (14:35 -0700)
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@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
src/logind-util.c

index 5c95874d69afece47e7ea2617f70c7fc785a3dbc..006a1aef4407821264be35e81cd24f12bed9bf42 100644 (file)
@@ -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%u", wl->vtnr);
        buf[sizeof(buf) - 1] = 0;
 
        wl->vt = open(buf, O_RDWR|O_CLOEXEC|O_NONBLOCK);