summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2015-02-06 12:54:46 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2015-02-06 13:38:33 +0100
commit59b2fd40eb3b248f88f972a6403d3f77bf4b5c0e (patch)
treefe9e0048e2392030f5b55fabe016b2e881684bb7 /common
parent95d04aa1134b3bcbf79d2c8aa4102ec486c59b80 (diff)
Use new vdagent_{strncpy,strcat}_s helpers
Diffstat (limited to 'common')
-rw-r--r--common/vdcommon.cpp8
-rw-r--r--common/vdcommon.h5
2 files changed, 9 insertions, 4 deletions
diff --git a/common/vdcommon.cpp b/common/vdcommon.cpp
index 40c9e13..5b52b1a 100644
--- a/common/vdcommon.cpp
+++ b/common/vdcommon.cpp
@@ -49,7 +49,9 @@ errno_t vdagent_strcat_s(char *strDestination,
return ERANGE;
}
- return strcat(strDestination, strSource);
+ strcat(strDestination, strSource);
+
+ return 0;
}
#endif
@@ -67,6 +69,8 @@ errno_t vdagent_strcpy_s(char *strDestination,
return ERANGE;
}
- return strcpy(strDestination, strSource);
+ strcpy(strDestination, strSource);
+
+ return 0;
}
#endif
diff --git a/common/vdcommon.h b/common/vdcommon.h
index 01bbbc8..db9257f 100644
--- a/common/vdcommon.h
+++ b/common/vdcommon.h
@@ -22,6 +22,7 @@
#pragma warning(disable:4200)
#endif
+#include <errno.h>
#include <windows.h>
#include "spice/vd_agent.h"
#include "vdlog.h"
@@ -78,7 +79,7 @@ typedef CRITICAL_SECTION mutex_t;
#else
errno_t vdagent_strcat_s(char *strDestination,
size_t numberOfElements,
- const char *strSource)
+ const char *strSource);
#endif
#ifdef HAVE_STRCPY_S
@@ -86,7 +87,7 @@ errno_t vdagent_strcat_s(char *strDestination,
#else
errno_t vdagent_strcpy_s(char *strDestination,
size_t numberOfElements,
- const char *strSource)
+ const char *strSource);
#endif
#ifdef _MSC_VER // compiling with Visual Studio