aboutsummaryrefslogtreecommitdiff
path: root/src/wrap.c
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2015-12-26 18:42:14 +0100
committerThomas White <taw@bitwiz.org.uk>2015-12-26 18:42:14 +0100
commit55a8c269d2e77f798f9ca55d7a4afb7a9f98a701 (patch)
treea4a68f8cc3987476b3dc36ef977482360a54dc49 /src/wrap.c
parent512a21e10151e4c694a1aa4f7dfe8faf7eec5e52 (diff)
Extra checks
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;