summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dged/buffer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dged/buffer.c b/src/dged/buffer.c
index 7eb4b00..733d4a4 100644
--- a/src/dged/buffer.c
+++ b/src/dged/buffer.c
@@ -581,7 +581,7 @@ struct location buffer_clamp(struct buffer *buffer, int64_t line, int64_t col) {
}
} else {
location.line = line;
- uint32_t nchars = buffer_num_chars(buffer, location.col);
+ uint32_t nchars = buffer_num_chars(buffer, location.line);
location.col = col > nchars ? nchars : col;
}