[X2Go-Commits] [libx2goclient] 02/02: src/x2goclient-utils.c: truncation size in x2goclient_strbrk_dup () should not be further decremented.
git-admin at x2go.org
git-admin at x2go.org
Fri Sep 18 03:04:34 CEST 2020
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository libx2goclient.
commit 21aaac171e1168241c951ff68ccc964e3ce66751
Author: Mihai Moldovan <ionic at ionic.de>
Date: Fri Sep 18 02:55:07 2020 +0200
src/x2goclient-utils.c: truncation size in x2goclient_strbrk_dup () should not be further decremented.
The needle position actually is the remaining string size, so don't
decrement it again.
---
src/x2goclient-utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c
index 6ee33c6..6ef4c1e 100644
--- a/src/x2goclient-utils.c
+++ b/src/x2goclient-utils.c
@@ -209,7 +209,7 @@ gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char need
/* Since needle was found, the difference must be at least one. */
g_assert (needle_pos - *haystack);
- gsize truncate_size = ((needle_pos - *haystack) - 1);
+ gsize truncate_size = (needle_pos - *haystack);
/* Don't copy the needle. */
ret = g_strndup (*haystack, truncate_size);
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/libx2goclient.git
More information about the x2go-commits
mailing list