Skip to content

Commit

Permalink
Fix unlikely conversion bug in zic
Browse files Browse the repository at this point in the history
* zic.c (puttzcode): Arg is zic_t, not int_fast32_t.  This fixes a
portability bug on platforms where int_fast32_t is a 32-bit ones’
complement or signed-magnitude integer, and where the argument is
-2**31 before conversion to int_fast32_t.  Although I don’t know
of any such platforms, the C standard allows them.
  • Loading branch information
eggert committed Nov 5, 2022
1 parent 4a69a06 commit f4808ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zic.c
Original file line number Diff line number Diff line change
Expand Up @@ -2216,7 +2216,7 @@ convert64(uint_fast64_t val, char *buf)
}

static void
puttzcode(const int_fast32_t val, FILE *const fp)
puttzcode(zic_t val, FILE *fp)
{
char buf[4];

Expand Down

0 comments on commit f4808ee

Please sign in to comment.