Skip to content

Commit

Permalink
Replace %ld with %jd and cast to intmax_t
Browse files Browse the repository at this point in the history
  • Loading branch information
H.J. Lu committed Dec 30, 2014
1 parent 5d619de commit ad86fbc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
* rt/tst-timer4.c: Include <stdint.h>.
(check_ts): Replace %ld with %jd and cast to intmax_t.
(do_test): Likewise.
* stdio-common/tst-fmemopen2.c (do_test): Replace %ld with %jd
and cast to intmax_t.

2014-12-30 Andrew Senkevich <andrew.senkevich@intel.com>
H.J. Lu <hongjiu.lu@intel.com>
Expand Down
11 changes: 7 additions & 4 deletions stdio-common/tst-fmemopen2.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ do_test (void)
off_t o = ftello (fp);
if (o != nstr)
{
printf ("first ftello returned %ld, expected %zu\n", o, nstr);
printf ("first ftello returned %jd, expected %zu\n",
(intmax_t) o, nstr);
result = 1;
}
rewind (fp);
o = ftello (fp);
if (o != 0)
{
printf ("second ftello returned %ld, expected 0\n", o);
printf ("second ftello returned %jd, expected 0\n", (intmax_t) o);
result = 1;
}
if (fseeko (fp, 0, SEEK_END) != 0)
Expand All @@ -39,7 +40,8 @@ do_test (void)
o = ftello (fp);
if (o != nstr)
{
printf ("third ftello returned %ld, expected %zu\n", o, nstr);
printf ("third ftello returned %jd, expected %zu\n",
(intmax_t) o, nstr);
result = 1;
}
rewind (fp);
Expand All @@ -50,7 +52,8 @@ do_test (void)
o = ftello (fp);
if (o != nstr2)
{
printf ("fourth ftello returned %ld, expected %zu\n", o, nstr2);
printf ("fourth ftello returned %jd, expected %zu\n",
(intmax_t) o, nstr2);
result = 1;
}
fclose (fp);
Expand Down

0 comments on commit ad86fbc

Please sign in to comment.