projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f954b60
)
fixed checking valid range for drawing wrapped text
author
Holger Schemel
<holger.schemel@virtion.de>
Mon, 14 Oct 2024 21:26:21 +0000
(23:26 +0200)
committer
Holger Schemel
<holger.schemel@virtion.de>
Mon, 14 Oct 2024 21:26:35 +0000
(23:26 +0200)
src/libgame/text.c
patch
|
blob
|
history
diff --git
a/src/libgame/text.c
b/src/libgame/text.c
index 0f1c05f9157a605f55b140af27c112fbc526457e..d946f7721d2433f26d7f553bc3de59e5f2591edd 100644
(file)
--- a/
src/libgame/text.c
+++ b/
src/libgame/text.c
@@
-765,7
+765,7
@@
int DrawWrappedText(int x, int y, struct WrappedTextInfo *wrapped_text, int star
if (wrapped_text == NULL)
return 0;
- if (start_pos >= wrapped_text->num_lines)
+ if (start_pos
< 0 || start_pos
>= wrapped_text->num_lines)
return 0;
wrapped_text->line_visible_first = start_pos;