summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hook.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/hook.c b/hook.c
index 8d2eb22..7dd6da0 100644
--- a/hook.c
+++ b/hook.c
@@ -934,7 +934,9 @@ confirm_label:
}
memcpy(einfo.line, block.ptr, block.length);
length = block.length;
- for (position += length; position < to; position += block.length) {
+ for (position += length;
+ position < to && block.length;
+ position += block.length) {
XawTextSourceRead(source, position, &block, to - position);
memcpy(einfo.line + length, block.ptr, block.length);
length += block.length;