summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Cervin <albert@acervin.com>2024-01-26 08:44:32 +0100
committerAlbert Cervin <albert@acervin.com>2024-01-26 08:44:32 +0100
commit1a5946eca41fbe33df17efc933fa33574af3c3a9 (patch)
treebee2f57bbbc5803edabb8d09938fae2217af9b98
parentf384a3826bae1eb9f500ad6b9dbaa5f904dfbf42 (diff)
downloaddged-1a5946eca41fbe33df17efc933fa33574af3c3a9.tar.gz
dged-1a5946eca41fbe33df17efc933fa33574af3c3a9.tar.xz
dged-1a5946eca41fbe33df17efc933fa33574af3c3a9.zip
Fix clamp using column instead of line
-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;
}