mirror of
https://github.com/Karaka-Management/cOMS.git
synced 2026-02-10 23:58:39 +00:00
fix compilation bugs
This commit is contained in:
parent
593fbc9f89
commit
2322ffdc85
|
|
@ -17,11 +17,11 @@
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
|
|
||||||
typedef _chdir chdir;
|
#define _chdir chdir;
|
||||||
typedef _getcwd getcwd;
|
#define _getcwd getcwd;
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
typedef _access_s access;
|
#define _access_s access;
|
||||||
#else
|
#else
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ namespace Utils
|
||||||
size_t c = 0;
|
size_t c = 0;
|
||||||
while (*haystack && c < i + match * (newLength - oldLength)) {
|
while (*haystack && c < i + match * (newLength - oldLength)) {
|
||||||
if (strstr(haystack, needle) == haystack) {
|
if (strstr(haystack, needle) == haystack) {
|
||||||
strcpy(&result[c], replace);
|
strcpy(&result[c], (char *) replace);
|
||||||
|
|
||||||
c += newLength;
|
c += newLength;
|
||||||
haystack += oldLength;
|
haystack += oldLength;
|
||||||
|
|
@ -125,7 +125,7 @@ namespace Utils
|
||||||
char *token;
|
char *token;
|
||||||
int i = 0;
|
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));
|
list[i] = (char *) malloc(strlen(token + 1) * sizeof(char));
|
||||||
memcpy(list[i], token, (strlen(token) + 1) * sizeof(char));
|
memcpy(list[i], token, (strlen(token) + 1) * sizeof(char));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user