Skip to content

Commit

Permalink
Merge pull request #55 from seleznevae/issue-54
Browse files Browse the repository at this point in the history
Fix invalid pointer to integer cast that might cause problems on some platforms
  • Loading branch information
seleznevae authored Sep 24, 2020
2 parents 1758872 + 5bae83b commit d9ee76a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Internal

- Add builds with gcc-9 to CI.
- Fix invalid pointer to integer cast that might cause problems on some platforms.

## v0.4.1

Expand Down
2 changes: 1 addition & 1 deletion lib/fort.c
Original file line number Diff line number Diff line change
Expand Up @@ -6867,7 +6867,7 @@ int buffer_check_align(f_string_buffer_t *buffer)
return 1;
#ifdef FT_HAVE_WCHAR
case W_CHAR_BUF:
return (((unsigned long)buffer->str.data) & (sizeof(wchar_t) - 1)) == 0;
return (((uintptr_t)buffer->str.data) & (sizeof(wchar_t) - 1)) == 0;
#endif
#ifdef FT_HAVE_UTF8
case UTF8_BUF:
Expand Down
2 changes: 1 addition & 1 deletion src/string_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ int buffer_check_align(f_string_buffer_t *buffer)
return 1;
#ifdef FT_HAVE_WCHAR
case W_CHAR_BUF:
return (((unsigned long)buffer->str.data) & (sizeof(wchar_t) - 1)) == 0;
return (((uintptr_t)buffer->str.data) & (sizeof(wchar_t) - 1)) == 0;
#endif
#ifdef FT_HAVE_UTF8
case UTF8_BUF:
Expand Down

0 comments on commit d9ee76a

Please sign in to comment.