[tracker: 6/14] tracker-utils: Fix glong vs gsize comparison
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker: 6/14] tracker-utils: Fix glong vs gsize comparison
- Date: Sat, 8 May 2021 17:25:48 +0000 (UTC)
commit 969156905e1a1204325606a4e39086a544051c3f
Author: Daniele Nicolodi <daniele grinta net>
Date: Sun May 2 12:39:30 2021 +0200
tracker-utils: Fix glong vs gsize comparison
This introduces a somehow ugly cast. The GLib g_utf8_ family of
functions uses glong for string lengths, thus another maybe more
correct solution would be to change tracker_utf8_truncate() parameter
to glong, but this would maybe require adapting other variables too.
src/libtracker-common/tracker-utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/libtracker-common/tracker-utils.c b/src/libtracker-common/tracker-utils.c
index 3c03a79a1..5ef1c4322 100644
--- a/src/libtracker-common/tracker-utils.c
+++ b/src/libtracker-common/tracker-utils.c
@@ -93,7 +93,7 @@ tracker_utf8_truncate (const gchar *str,
{
gchar *retv = NULL;
- if (g_utf8_strlen (str, -1) > max_size) {
+ if ((gsize) g_utf8_strlen (str, -1) > max_size) {
gchar *substring = g_utf8_substring (str, 0, max_size - 3);
retv = g_strdup_printf ("%s[…]", substring);
g_free (substring);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]