mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-23 19:02:07 +03:00
Initialise return values in error cases, too: core code is horrifically lax at checking errors from these APIs.
This commit is contained in:
parent
30dfa09008
commit
23e16e020e
@ -255,6 +255,7 @@ bool nsfont_width(const plot_font_style_t *fstyle,
|
||||
else
|
||||
LOG(("rufl_width: 0x%x", code));
|
||||
/* warn_user("MiscError", "font error"); */
|
||||
*width = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -303,6 +304,8 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
|
||||
else
|
||||
LOG(("rufl_x_to_offset: 0x%x", code));
|
||||
/* warn_user("MiscError", "font error"); */
|
||||
*char_offset = 0;
|
||||
*actual_x = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -355,6 +358,8 @@ bool nsfont_split(const plot_font_style_t *fstyle,
|
||||
else
|
||||
LOG(("rufl_split: 0x%x", code));
|
||||
/* warn_user("MiscError", "font error"); */
|
||||
*char_offset = 0;
|
||||
*actual_x = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -386,6 +391,8 @@ bool nsfont_split(const plot_font_style_t *fstyle,
|
||||
else
|
||||
LOG(("rufl_width: 0x%x", code));
|
||||
/* warn_user("MiscError", "font error"); */
|
||||
*char_offset = 0;
|
||||
*actual_x = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user