]> git.proxmox.com Git - ovs.git/blobdiff - lib/dynamic-string.c
tc: Support new terse dump kernel API
[ovs.git] / lib / dynamic-string.c
index a5a3460ef9ad70d3c5c41576038a9b54cc3e0ad2..6f7b610a9908956904c87c90e8cf71edbed13047 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include <config.h>
-#include "dynamic-string.h"
+#include "openvswitch/dynamic-string.h"
 #include <inttypes.h>
 #include <stdlib.h>
 #include <string.h>
@@ -456,3 +456,12 @@ ds_chomp(struct ds *ds, int c)
         return false;
     }
 }
+
+void
+ds_clone(struct ds *dst, struct ds *source)
+{
+    dst->length = source->length;
+    dst->allocated = dst->length;
+    dst->string = xmalloc(dst->allocated + 1);
+    memcpy(dst->string, source->string, dst->allocated + 1);
+}