summaryrefslogtreecommitdiff
path: root/libs/utils/Debug.cpp
diff options
context:
space:
mode:
author Andrew Hsieh <andrewhsieh@google.com> 2012-02-27 18:50:55 -0800
committer Andrew Hsieh <andrewhsieh@google.com> 2012-02-27 18:50:55 -0800
commitd9df224570325c41f9aa9f3a25bf4baf828065f2 (patch)
treed4604285742530f34dd3895ee3f83450a3d8519a /libs/utils/Debug.cpp
parent4709a11b5dcb0abb5f8518e0404b67a0912c0167 (diff)
Fixed several 64-bit porting issues
1. Use "%zu" instead of "%d" for size_t in printf 2. Variable precision specifier (eg. "%.*s") in printf should be of type int. (iov_len is size_t which is 64-bit when compiled with -m64) 3. Use PRId64 instead of "%lld" to print variables of type int64_t Change-Id: I2be40a6514b5dffa0038d62b9bccc3401b8756e6
Diffstat (limited to 'libs/utils/Debug.cpp')
-rw-r--r--libs/utils/Debug.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/utils/Debug.cpp b/libs/utils/Debug.cpp
index f7988ecf1d16..e8ac983ead52 100644
--- a/libs/utils/Debug.cpp
+++ b/libs/utils/Debug.cpp
@@ -199,7 +199,7 @@ void printHexData(int32_t indent, const void *buf, size_t length,
if ((int32_t)length < 0) {
if (singleLineBytesCutoff < 0) func(cookie, "\n");
char buf[64];
- sprintf(buf, "(bad length: %d)", length);
+ sprintf(buf, "(bad length: %zu)", length);
func(cookie, buf);
return;
}