Skip to content

Commit

Permalink
Fix printf conversion for header dump
Browse files Browse the repository at this point in the history
  • Loading branch information
yoheie committed Oct 6, 2016
1 parent 792a675 commit 003664d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/header.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ dump_get_byte()
int c;

if (verbose_listing && verbose > 1)
printf("%02d %2d: ", get_ptr - start_ptr, 1);
printf("%02ld %2d: ", (long)(get_ptr - start_ptr), 1);
c = _get_byte();
if (verbose_listing && verbose > 1) {
if (isprint(c))
Expand All @@ -112,7 +112,7 @@ dump_skip_bytes(len)
{
if (len == 0) return;
if (verbose_listing && verbose > 1) {
printf("%02d %2d: ", get_ptr - start_ptr, len);
printf("%02ld %2d: ", (long)(get_ptr - start_ptr), len);
if (len < 0) {
error("Invalid header: %d", len);
exit(1);
Expand All @@ -134,7 +134,7 @@ get_word()

#if DUMP_HEADER
if (verbose_listing && verbose > 1)
printf("%02d %2d: ", get_ptr - start_ptr, 2);
printf("%02ld %2d: ", (long)(get_ptr - start_ptr), 2);
#endif
b0 = _get_byte();
b1 = _get_byte();
Expand Down Expand Up @@ -162,7 +162,7 @@ get_longword()

#if DUMP_HEADER
if (verbose_listing && verbose > 1)
printf("%02d %2d: ", get_ptr - start_ptr, 4);
printf("%02ld %2d: ", (long)(get_ptr - start_ptr), 4);
#endif
b0 = _get_byte();
b1 = _get_byte();
Expand Down Expand Up @@ -194,7 +194,7 @@ get_longlongword()

#if DUMP_HEADER
if (verbose_listing && verbose > 1)
printf("%02d %2d: ", get_ptr - start_ptr, 4);
printf("%02ld %2d: ", (long)(get_ptr - start_ptr), 4);
#endif
b0 = _get_byte();
b1 = _get_byte();
Expand Down Expand Up @@ -238,7 +238,7 @@ get_bytes(buf, len, size)

#if DUMP_HEADER
if (verbose_listing && verbose > 1)
printf("%02d %2d: \"", get_ptr - start_ptr, len);
printf("%02ld %2d: \"", (long)(get_ptr - start_ptr), len);
if (len < 0) {
error("Invalid header: %d", len);
exit(1);
Expand Down

0 comments on commit 003664d

Please sign in to comment.