summaryrefslogtreecommitdiff
path: root/src/http_decoder_utils.cpp
diff options
context:
space:
mode:
authorlijia <[email protected]>2024-05-24 22:47:32 +0800
committerlijia <[email protected]>2024-05-26 19:45:15 +0800
commit50a9fea27ca30d532bf89bc8fd7e6025a240e9e4 (patch)
treee066e771c8a4abb3f1997ea3e0aebcb2d259f85e /src/http_decoder_utils.cpp
parent22d071e23ff423242f51dce2eab1477b5fb9d106 (diff)
Adapt to stellar v2.0v2.0.1
Diffstat (limited to 'src/http_decoder_utils.cpp')
-rw-r--r--src/http_decoder_utils.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/http_decoder_utils.cpp b/src/http_decoder_utils.cpp
new file mode 100644
index 0000000..77d716d
--- /dev/null
+++ b/src/http_decoder_utils.cpp
@@ -0,0 +1,21 @@
+/*
+**********************************************************************************************
+* File: http_decoder_utils.c
+* Description:
+* Authors: LuWenPeng <[email protected]>
+* Date: 2022-10-31
+* Copyright: (c) Since 2022 Geedge Networks, Ltd. All rights reserved.
+***********************************************************************************************
+*/
+#include <string.h>
+#include "http_decoder_inc.h"
+
+char *safe_dup(const char *str, size_t len)
+{
+ if (str == NULL || len == 0) {
+ return NULL;
+ }
+ char *dup = CALLOC(char, len + 1);
+ memcpy(dup, str, len);
+ return dup;
+} \ No newline at end of file