summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Micay2015-10-13 15:18:45 -0500
committerDaniel Micay2015-10-13 15:22:33 -0500
commitaf090a6ea897f90c02ffde8a1b49f76c426d9d31 (patch)
treee27da3b6c8ad237c23254acb74b6d692611e65e4 /libsparse
parent9b3a2784b94d88492906384ab3f3c9863f6b5eea (diff)
downloadplatform-system-core-af090a6ea897f90c02ffde8a1b49f76c426d9d31.tar.gz
platform-system-core-af090a6ea897f90c02ffde8a1b49f76c426d9d31.tar.xz
platform-system-core-af090a6ea897f90c02ffde8a1b49f76c426d9d31.zip
fix misuse of formatting specifiers
The Clang/GCC formatting warning triggers for usage of %lld with off_t on 64-bit because it's defined as a long int, not a long long int. It isn't important, but it's technically undefined. This fix is in anticipation of adding __attribute__((format(...))) to many functions where it is currently missing. Change-Id: I2bf33e6563a2892d2f54d7c582cbdeadf867e84f
Diffstat (limited to 'libsparse')
-rw-r--r--libsparse/sparse_read.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libsparse/sparse_read.c b/libsparse/sparse_read.c
index 9b10293fe..ec63850d8 100644
--- a/libsparse/sparse_read.c
+++ b/libsparse/sparse_read.c
@@ -18,6 +18,7 @@
18#define _FILE_OFFSET_BITS 64 18#define _FILE_OFFSET_BITS 64
19#define _LARGEFILE64_SOURCE 1 19#define _LARGEFILE64_SOURCE 1
20 20
21#include <inttypes.h>
21#include <fcntl.h> 22#include <fcntl.h>
22#include <stdarg.h> 23#include <stdarg.h>
23#include <stdbool.h> 24#include <stdbool.h>
@@ -233,7 +234,7 @@ static int process_chunk(struct sparse_file *s, int fd, off64_t offset,
233 ret = process_raw_chunk(s, chunk_data_size, fd, offset, 234 ret = process_raw_chunk(s, chunk_data_size, fd, offset,
234 chunk_header->chunk_sz, cur_block, crc_ptr); 235 chunk_header->chunk_sz, cur_block, crc_ptr);
235 if (ret < 0) { 236 if (ret < 0) {
236 verbose_error(s->verbose, ret, "data block at %lld", offset); 237 verbose_error(s->verbose, ret, "data block at %" PRId64, offset);
237 return ret; 238 return ret;
238 } 239 }
239 return chunk_header->chunk_sz; 240 return chunk_header->chunk_sz;
@@ -241,7 +242,7 @@ static int process_chunk(struct sparse_file *s, int fd, off64_t offset,
241 ret = process_fill_chunk(s, chunk_data_size, fd, 242 ret = process_fill_chunk(s, chunk_data_size, fd,
242 chunk_header->chunk_sz, cur_block, crc_ptr); 243 chunk_header->chunk_sz, cur_block, crc_ptr);
243 if (ret < 0) { 244 if (ret < 0) {
244 verbose_error(s->verbose, ret, "fill block at %lld", offset); 245 verbose_error(s->verbose, ret, "fill block at %" PRId64, offset);
245 return ret; 246 return ret;
246 } 247 }
247 return chunk_header->chunk_sz; 248 return chunk_header->chunk_sz;
@@ -250,7 +251,7 @@ static int process_chunk(struct sparse_file *s, int fd, off64_t offset,
250 chunk_header->chunk_sz, cur_block, crc_ptr); 251 chunk_header->chunk_sz, cur_block, crc_ptr);
251 if (chunk_data_size != 0) { 252 if (chunk_data_size != 0) {
252 if (ret < 0) { 253 if (ret < 0) {
253 verbose_error(s->verbose, ret, "skip block at %lld", offset); 254 verbose_error(s->verbose, ret, "skip block at %" PRId64, offset);
254 return ret; 255 return ret;
255 } 256 }
256 } 257 }
@@ -258,13 +259,13 @@ static int process_chunk(struct sparse_file *s, int fd, off64_t offset,
258 case CHUNK_TYPE_CRC32: 259 case CHUNK_TYPE_CRC32:
259 ret = process_crc32_chunk(fd, chunk_data_size, *crc_ptr); 260 ret = process_crc32_chunk(fd, chunk_data_size, *crc_ptr);
260 if (ret < 0) { 261 if (ret < 0) {
261 verbose_error(s->verbose, -EINVAL, "crc block at %lld", 262 verbose_error(s->verbose, -EINVAL, "crc block at %" PRId64,
262 offset); 263 offset);
263 return ret; 264 return ret;
264 } 265 }
265 return 0; 266 return 0;
266 default: 267 default:
267 verbose_error(s->verbose, -EINVAL, "unknown block %04X at %lld", 268 verbose_error(s->verbose, -EINVAL, "unknown block %04X at %" PRId64,
268 chunk_header->chunk_type, offset); 269 chunk_header->chunk_type, offset);
269 } 270 }
270 271