fix compilation bugs

This commit is contained in:
Dennis Eichhorn 2023-04-23 21:09:59 +02:00
parent 593fbc9f89
commit 2322ffdc85
2 changed files with 5 additions and 5 deletions

View File

@ -17,11 +17,11 @@
#include <direct.h>
#include <io.h>
typedef _chdir chdir;
typedef _getcwd getcwd;
#define _chdir chdir;
#define _getcwd getcwd;
#ifdef _MSC_VER
typedef _access_s access;
#define _access_s access;
#else
#include <unistd.h>
#endif

View File

@ -47,7 +47,7 @@ namespace Utils
size_t c = 0;
while (*haystack && c < i + match * (newLength - oldLength)) {
if (strstr(haystack, needle) == haystack) {
strcpy(&result[c], replace);
strcpy(&result[c], (char *) replace);
c += newLength;
haystack += oldLength;
@ -125,7 +125,7 @@ namespace Utils
char *token;
int i = 0;
while ((token = strsep(&str, &delim)) != NULL) {
while ((token = strsep(&str, (char *) & delim)) != NULL) {
list[i] = (char *) malloc(strlen(token + 1) * sizeof(char));
memcpy(list[i], token, (strlen(token) + 1) * sizeof(char));