[X2Go-Commits] [libx2goclient] 130/132: src/x2goclient-utils.c: add more parenthesis to x2goclient_strbrk_dup ().

git-admin at x2go.org git-admin at x2go.org
Fri Dec 3 15:26:37 CET 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository libx2goclient.

commit c0ea534411049fd6977081926e75742ed93c7b6b
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Fri Dec 3 13:44:26 2021 +0100

    src/x2goclient-utils.c: add more parenthesis to x2goclient_strbrk_dup ().
---
 src/x2goclient-utils.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/x2goclient-utils.c b/src/x2goclient-utils.c
index 78859b9..29da213 100644
--- a/src/x2goclient-utils.c
+++ b/src/x2goclient-utils.c
@@ -231,33 +231,33 @@ long long int x2goclient_str_to_int (const gchar * const restrict str, const _Bo
 gchar* x2goclient_strbrk_dup (gchar * restrict * const haystack, const char needle, const _Bool free_orig, gsize * const new_size) {
   gchar *ret = NULL;
 
-  g_return_val_if_fail (((NULL != haystack) && (NULL != *haystack)), ret);
+  g_return_val_if_fail (((NULL != haystack) && (NULL != (*(haystack)))), ret);
 
-  const gchar *needle_pos = strchr (*haystack, needle);
+  const gchar *needle_pos = strchr (*(haystack), needle);
 
   if (!(needle_pos)) {
     /* Optimization: don't copy. */
-    ret = *haystack;
-    *haystack = NULL;
+    ret = (*(haystack));
+    (*(haystack)) = NULL;
   }
   else {
     /* Since needle was found, the difference must be at least one. */
-    g_assert (needle_pos - *haystack);
+    g_assert (needle_pos - (*(haystack)));
 
-    gsize truncate_size = (needle_pos - *haystack);
+    gsize truncate_size = (needle_pos - (*(haystack)));
 
     /* Don't copy the needle. */
-    ret = g_strndup (*haystack, truncate_size);
+    ret = g_strndup (*(haystack), truncate_size);
 
     if (ret) {
       if (free_orig) {
         /* Get rid of the original string. */
-        g_free (*haystack);
-        *haystack = NULL;
+        g_free (*(haystack));
+        (*(haystack)) = NULL;
       }
 
       if (new_size) {
-        *new_size = truncate_size;
+        (*(new_size)) = 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