From ab4da04de699562828ec565b649a9d74edbfe04c Mon Sep 17 00:00:00 2001 From: Brad Arant Date: Tue, 26 Nov 2024 09:48:56 -0800 Subject: [PATCH] fixed cursor destruction on getLineNumberAtCursor() method to ZString. --- ZString.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ZString.cpp b/ZString.cpp index 172c31d..e802d0a 100644 --- a/ZString.cpp +++ b/ZString.cpp @@ -576,9 +576,10 @@ namespace coreutils { } int ZString::getLineNumberAtCursor() { + char *temp = cursor; int line = 1; - while(cursor != data) - if(*cursor-- == '\n') + while(temp != data) + if(*temp-- == '\n') ++line; return line; }