Commit 21aaac17 authored by Mihai Moldovan's avatar Mihai Moldovan
Browse files

src/x2goclient-utils.c: truncation size in x2goclient_strbrk_dup () should not...

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.
parent 1e673c09
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment