diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-12-10 20:24:18 +0100 |
---|---|---|
committer | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2014-12-11 21:47:06 +0100 |
commit | c4ef05484df942b6cc2037d33dd56cd209d1db9b (patch) | |
tree | 57a8709fb63978decef7e480d5ef12b4af1e3b86 | |
parent | 015df1f78f443f91b354e0c4b4cb76de86c838eb (diff) |
use correct format types
-rw-r--r-- | src/libsystemd-network/test-dhcp-option.c | 4 | ||||
-rw-r--r-- | src/libudev/libudev-device.c | 2 | ||||
-rw-r--r-- | src/login/loginctl.c | 2 | ||||
-rw-r--r-- | src/udev/cdrom_id/cdrom_id.c | 10 | ||||
-rw-r--r-- | src/udev/collect/collect.c | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/src/libsystemd-network/test-dhcp-option.c b/src/libsystemd-network/test-dhcp-option.c index eac3844f96..46c8c27061 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 16ee1f4be3..825a0e10f4 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 6505eb89c1..6881edb7e4 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 48ceb657e0..8a41c4f2bd 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 90df360eb2..16675fbe0e 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; |