From: Razvan Cojocaru <[email protected]>

gc_strdup() duplicated string_alloc() for its only caller. While here,
fix the typos in the message_splitter() comment.

Change-Id: Ib33ce23448959673affdfd462b4c2cfa9a015f55
Signed-off-by: Razvan Cojocaru <[email protected]>
Acked-by: Frank Lichtenheld <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2132
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2132
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]>

        
diff --git a/src/openvpn/push_util.c b/src/openvpn/push_util.c
index 34cb26c..0c27575 100644
--- a/src/openvpn/push_util.c
+++ b/src/openvpn/push_util.c
@@ -78,17 +78,8 @@
     return buf;
 }
 
-static char *
-gc_strdup(const char *src, struct gc_arena *gc)
-{
-    char *ret = gc_malloc((strlen(src) + 1) * sizeof(char), true, gc);
-
-    strcpy(ret, src);
-    return ret;
-}
-
-/* It split the messagge (if necessary) and fill msgs with the message chunks.
- * Return `false` on failure an `true` on success.
+/* Split the message (if necessary) and fill msgs with the message chunks.
+ * Return `false` on failure and `true` on success.
  */
 static bool
 message_splitter(const char *s, struct buffer_list *msgs, struct gc_arena *gc, 
const size_t safe_cap)
@@ -98,7 +89,7 @@
         return false;
     }
 
-    char *str = gc_strdup(s, gc);
+    char *str = string_alloc(s, gc);
 
     while (*str)
     {


_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to