summaryrefslogtreecommitdiff
path: root/src/ring.cc
diff options
context:
space:
mode:
authorEgmont Koblinger <egmont@gmail.com>2019-10-11 13:04:41 +0200
committerEgmont Koblinger <egmont@gmail.com>2019-10-11 13:04:41 +0200
commit7f6e48ce00eb0fd6992966a66df6464e85cfda84 (patch)
tree5d1b9fb323e2267f9fdfabd5fb4a41a0b2adbde5 /src/ring.cc
parenta6cb948d2c352056b79e04efd372f88f84b8e0a1 (diff)
downloadvte-7f6e48ce00eb0fd6992966a66df6464e85cfda84.tar.gz
ring: Tiny code cleanup: maintain GString integrity
Diffstat (limited to 'src/ring.cc')
-rw-r--r--src/ring.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ring.cc b/src/ring.cc
index 9981901b..2d76d136 100644
--- a/src/ring.cc
+++ b/src/ring.cc
@@ -1026,7 +1026,7 @@ Ring::frozen_row_column_to_text_offset(row_t position,
return false;
if (G_LIKELY (buffer->len && buffer->str[buffer->len - 1] == '\n'))
- buffer->len--;
+ g_string_truncate (buffer, buffer->len - 1);
row = index(position);
@@ -1101,7 +1101,7 @@ Ring::frozen_row_text_offset_to_column(row_t position,
return false;
if (G_LIKELY (buffer->len && buffer->str[buffer->len - 1] == '\n'))
- buffer->len--;
+ g_string_truncate (buffer, buffer->len - 1);
/* Now that we've chopped off the likely trailing newline (which is only rarely missing,
* if the ring ends in a soft wrapped line; see bug 181), the position we're about to