diff options
author | Thomas White <taw@bitwiz.org.uk> | 2015-12-26 18:42:14 +0100 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2015-12-26 18:42:14 +0100 |
commit | 55a8c269d2e77f798f9ca55d7a4afb7a9f98a701 (patch) | |
tree | a4a68f8cc3987476b3dc36ef977482360a54dc49 /src/wrap.c | |
parent | 512a21e10151e4c694a1aa4f7dfe8faf7eec5e52 (diff) |
Extra checks
Diffstat (limited to 'src/wrap.c')
-rw-r--r-- | src/wrap.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |