Use %zu to printf size_t correctly on both 32-bit and 64-bit platforms.
Change-Id: I5223e574084fca47606b844d74a99a642c7d66be
diff --git a/server/RouteController.cpp b/server/RouteController.cpp
index 30bdae8..411447e 100644
--- a/server/RouteController.cpp
+++ b/server/RouteController.cpp
@@ -140,7 +140,7 @@
ALOGE("netlink response contains error (%s)", strerror(-ret));
}
} else {
- ALOGE("bad netlink response message size (%d != %u)", ret, sizeof(response));
+ ALOGE("bad netlink response message size (%d != %zu)", ret, sizeof(response));
ret = -EBADMSG;
}
} else {
@@ -181,7 +181,7 @@
if (interface) {
interfaceLength = strlcpy(oifname, interface, IFNAMSIZ) + 1;
if (interfaceLength > IFNAMSIZ) {
- ALOGE("interface name too long (%u > %u)", interfaceLength, IFNAMSIZ);
+ ALOGE("interface name too long (%zu > %zu)", interfaceLength, IFNAMSIZ);
return -ENAMETOOLONG;
}
paddingLength = RTA_SPACE(interfaceLength) - RTA_LENGTH(interfaceLength);
@@ -189,7 +189,7 @@
// Either both start and end UID must be specified, or neither.
if ((uidStart == INVALID_UID) != (uidEnd == INVALID_UID)) {
- ALOGE("incompatible start and end UIDs (%u vs %u)", uidStart, uidEnd);
+ ALOGE("incompatible start and end UIDs (%zu vs %zu)", uidStart, uidEnd);
return -EUSERS;
}
bool isUidRule = (uidStart != INVALID_UID);
@@ -254,7 +254,7 @@
}
if (static_cast<size_t>(rawLength) > sizeof(rawAddress)) {
- ALOGE("impossible! address too long (%d vs %u)", rawLength, sizeof(rawAddress));
+ ALOGE("impossible! address too long (%d vs %zu)", rawLength, sizeof(rawAddress));
return -ENOBUFS; // Cannot happen; parsePrefix only supports IPv4 and IPv6.
}