[systemd-commits] src/libsystemd-network src/libudev src/login src/udev

Thomas H.P. Andersen phomes at kemper.freedesktop.org
Thu Dec 11 13:03:57 PST 2014


 src/libsystemd-network/test-dhcp-option.c |    4 ++--
 src/libudev/libudev-device.c              |    2 +-
 src/login/loginctl.c                      |    2 +-
 src/udev/cdrom_id/cdrom_id.c              |   10 +++++-----
 src/udev/collect/collect.c                |    2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit c4ef05484df942b6cc2037d33dd56cd209d1db9b
Author: Thomas Hindoe Paaboel Andersen <phomes at gmail.com>
Date:   Wed Dec 10 20:24:18 2014 +0100

    use correct format types

diff --git a/src/libsystemd-network/test-dhcp-option.c b/src/libsystemd-network/test-dhcp-option.c
index eac3844..46c8c27 100644
--- a/src/libsystemd-network/test-dhcp-option.c
+++ b/src/libsystemd-network/test-dhcp-option.c
@@ -344,7 +344,7 @@ static void test_option_set(void)
 
         for (i = 0; i < 9; i++) {
                 if (verbose)
-                        printf("%2d: 0x%02x(0x%02x) (options)\n", i, result->options[i],
+                        printf("%2u: 0x%02x(0x%02x) (options)\n", i, result->options[i],
                                options[i]);
                 assert_se(result->options[i] == options[i]);
         }
@@ -363,7 +363,7 @@ static void test_option_set(void)
 
         for (i = 0; i < pos - 8; i++) {
                 if (verbose)
-                        printf("%2d: 0x%02x(0x%02x) (sname)\n", i, result->sname[i],
+                        printf("%2u: 0x%02x(0x%02x) (sname)\n", i, result->sname[i],
                                options[i + 9]);
                 assert_se(result->sname[i] == options[i + 9]);
         }
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
index 16ee1f4..825a0e1 100644
--- a/src/libudev/libudev-device.c
+++ b/src/libudev/libudev-device.c
@@ -139,7 +139,7 @@ static int udev_device_set_ifindex(struct udev_device *udev_device, int ifindex)
         char num[32];
 
         udev_device->ifindex = ifindex;
-        snprintf(num, sizeof(num), "%u", ifindex);
+        snprintf(num, sizeof(num), "%d", ifindex);
         udev_device_add_property(udev_device, "IFINDEX", num);
         return 0;
 }
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index 6505eb8..6881edb 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -423,7 +423,7 @@ static int print_session_status_info(sd_bus *bus, const char *path, bool *new_li
                 printf("\t    Seat: %s", i.seat);
 
                 if (i.vtnr > 0)
-                        printf("; vc%i", i.vtnr);
+                        printf("; vc%u", i.vtnr);
 
                 printf("\n");
         }
diff --git a/src/udev/cdrom_id/cdrom_id.c b/src/udev/cdrom_id/cdrom_id.c
index 48ceb65..8a41c4f 100644
--- a/src/udev/cdrom_id/cdrom_id.c
+++ b/src/udev/cdrom_id/cdrom_id.c
@@ -1063,17 +1063,17 @@ work:
         if (cd_media_state != NULL)
                 printf("ID_CDROM_MEDIA_STATE=%s\n", cd_media_state);
         if (cd_media_session_next > 0)
-                printf("ID_CDROM_MEDIA_SESSION_NEXT=%d\n", cd_media_session_next);
+                printf("ID_CDROM_MEDIA_SESSION_NEXT=%u\n", cd_media_session_next);
         if (cd_media_session_count > 0)
-                printf("ID_CDROM_MEDIA_SESSION_COUNT=%d\n", cd_media_session_count);
+                printf("ID_CDROM_MEDIA_SESSION_COUNT=%u\n", cd_media_session_count);
         if (cd_media_session_count > 1 && cd_media_session_last_offset > 0)
                 printf("ID_CDROM_MEDIA_SESSION_LAST_OFFSET=%llu\n", cd_media_session_last_offset);
         if (cd_media_track_count > 0)
-                printf("ID_CDROM_MEDIA_TRACK_COUNT=%d\n", cd_media_track_count);
+                printf("ID_CDROM_MEDIA_TRACK_COUNT=%u\n", cd_media_track_count);
         if (cd_media_track_count_audio > 0)
-                printf("ID_CDROM_MEDIA_TRACK_COUNT_AUDIO=%d\n", cd_media_track_count_audio);
+                printf("ID_CDROM_MEDIA_TRACK_COUNT_AUDIO=%u\n", cd_media_track_count_audio);
         if (cd_media_track_count_data > 0)
-                printf("ID_CDROM_MEDIA_TRACK_COUNT_DATA=%d\n", cd_media_track_count_data);
+                printf("ID_CDROM_MEDIA_TRACK_COUNT_DATA=%u\n", cd_media_track_count_data);
 exit:
         if (fd >= 0)
                 close(fd);
diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c
index 90df360..16675fb 100644
--- a/src/udev/collect/collect.c
+++ b/src/udev/collect/collect.c
@@ -153,7 +153,7 @@ static int checkout(int fd)
                         if (!ptr && word < (buf + len)) {
                                 bufsize = bufsize << 1;
                                 if (debug)
-                                        fprintf(stderr, "ID overflow, restarting with size %zi\n", bufsize);
+                                        fprintf(stderr, "ID overflow, restarting with size %zu\n", bufsize);
                                 free(buf);
                                 lseek(fd, 0, SEEK_SET);
                                 goto restart;



More information about the systemd-commits mailing list