summaryrefslogtreecommitdiff
path: root/source/utilities/String_s.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/utilities/String_s.cpp')
-rw-r--r--source/utilities/String_s.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/source/utilities/String_s.cpp b/source/utilities/String_s.cpp
new file mode 100644
index 0000000..c204ec8
--- /dev/null
+++ b/source/utilities/String_s.cpp
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (C) ST-Ericsson SA 2012
+ * License terms: 3-clause BSD license
+ ******************************************************************************/
+#include "String_s.h"
+
+char *strcpy_s(char *dst, size_t _Size, const char *src)
+{
+ return strncpy(dst, src, _Size);
+}
+
+int sprintf_s(char *dst, size_t _Size, const char *format, ...)
+{
+ va_list l;
+ int ReturnValue;
+
+ va_start(l, format);
+ ReturnValue = vsnprintf(dst, _Size, format, l);
+ va_end(l);
+
+ return ReturnValue;
+}
+
+char *strncpy_s(char *dst, const char *src, size_t _Size)
+{
+ return strncpy(dst, src, _Size);
+}
+
+#ifndef __MINGW32__
+int _stricmp(const char *s1, const char *s2)
+{
+ return strcasecmp(s1, s2);
+}
+#endif