Skip to content

eb_is_text_stopped: Fix crash when built with --enable-pthread#2

Open
mvf wants to merge 1 commit intomistydemeo:masterfrom
mvf:pr/pthread-crashfix
Open

eb_is_text_stopped: Fix crash when built with --enable-pthread#2
mvf wants to merge 1 commit intomistydemeo:masterfrom
mvf:pr/pthread-crashfix

Conversation

@mvf
Copy link
Copy Markdown

@mvf mvf commented May 21, 2022

This fixes a crash when built with --enable-pthread. eb_is_text_stopped() calls eb_lock() on the book struct itself, instead of its lock member. Compiler warns too:

readtext.c: In function ‘eb_is_text_stopped’:
readtext.c:1563:13: warning: passing argument 1 of ‘eb_lock’ from incompatible pointer type [-Wincompatible-pointer-types]
 1563 |     eb_lock(book);
      |             ^~~~
      |             |
      |             EB_Book * {aka struct EB_Book_Struct *}
In file included from readtext.c:33:
build-post.h:277:23: note: expected ‘EB_Lock *’ {aka ‘struct EB_Lock_Struct *’} but argument is of type ‘EB_Book *’ {aka ‘struct EB_Book_Struct *’}
277 | void eb_lock(EB_Lock *lock);
    |              ~~~~~~~~~^~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant