summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--riscos/font.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/riscos/font.c b/riscos/font.c
index 717b9606c..d92d5b521 100644
--- a/riscos/font.c
+++ b/riscos/font.c
@@ -358,8 +358,9 @@ bool nsfont_split(const plot_font_style_t *fstyle,
return false;
}
- while (*char_offset && string[*char_offset] != ' ')
- (*char_offset)--;
+ if (*char_offset != length)
+ while (*char_offset && string[*char_offset] != ' ')
+ (*char_offset)--;
code = rufl_width(font_family, font_style, font_size,
string, *char_offset,