aboutsummaryrefslogtreecommitdiff
path: root/src/wrap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wrap.c')
-rw-r--r--src/wrap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/wrap.c b/src/wrap.c
index c4ce531..fa383b3 100644
--- a/src/wrap.c
+++ b/src/wrap.c
@@ -126,6 +126,12 @@ int which_segment(struct wrap_box *box, int pos, int *err)
int i = 0;
int ch = 0;
+ if ( box->type != WRAP_BOX_PANGO ) {
+ fprintf(stderr, "which_segment() called on wrong box type.\n");
+ *err = 1;
+ return 0;
+ }
+
do {
if ( ch + box->segs[i].len_chars >= pos ) break;
ch += box->segs[i++].len_chars;