summaryrefslogtreecommitdiff
path: root/net/net-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/net-common.c')
-rw-r--r--net/net-common.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/net-common.c b/net/net-common.c
new file mode 100644
index 00000000000..a7f767d5e9c
--- /dev/null
+++ b/net/net-common.c
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0
+
+void copy_filename(char *dst, const char *src, int size)
+{
+ if (src && *src && (*src == '"')) {
+ ++src;
+ --size;
+ }
+
+ while ((--size > 0) && src && *src && (*src != '"'))
+ *dst++ = *src++;
+ *dst = '\0';
+}