diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:11:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 01:11:49 +0000 |
commit | 1b88cd5ee8510e90e69f885bfd730ce57621781c (patch) | |
tree | b6b33bd695258f68c68824029c279d660ee4b85e /lib/strutil/strutilutf8.c | |
parent | Adding upstream version 3:4.8.30. (diff) | |
download | mc-upstream.tar.xz mc-upstream.zip |
Adding upstream version 3:4.8.31.upstream/3%4.8.31upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/strutil/strutilutf8.c')
-rw-r--r-- | lib/strutil/strutilutf8.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/strutil/strutilutf8.c b/lib/strutil/strutilutf8.c index e143abe..9142f3d 100644 --- a/lib/strutil/strutilutf8.c +++ b/lib/strutil/strutilutf8.c @@ -1,7 +1,7 @@ /* UTF-8 strings utilities - Copyright (C) 2007-2023 + Copyright (C) 2007-2024 Free Software Foundation, Inc. Written by: @@ -901,12 +901,12 @@ str_utf8_offset_to_pos (const char *text, size_t length) else { int result; - GString *buffer; + char *buffer; - buffer = g_string_new (text); - str_utf8_fix_string (buffer->str); - result = g_utf8_offset_to_pointer (buffer->str, length) - buffer->str; - g_string_free (buffer, TRUE); + buffer = g_strdup (text); + str_utf8_fix_string (buffer); + result = g_utf8_offset_to_pointer (buffer, length) - buffer; + g_free (buffer); return result; } } |