Thu, 19 Jul 2018 16:28:37 +0200
fixes wrong buffer allocation on windows
dav/sync.c | file | annotate | diff | comparison | revisions | |
dav/system.c | file | annotate | diff | comparison | revisions | |
dav/system.h | file | annotate | diff | comparison | revisions |
--- a/dav/sync.c Wed Jul 11 17:08:25 2018 +0200 +++ b/dav/sync.c Thu Jul 19 16:28:37 2018 +0200 @@ -1291,7 +1291,7 @@ } char *new_path = util_concat_path(p, ent->name); - int isdir; + int isdir = 0; LocalResource *res = local_resource_new(dir, db, new_path, &isdir); if(isdir) { resources = ucx_list_append(resources, res);
--- a/dav/system.c Wed Jul 11 17:08:25 2018 +0200 +++ b/dav/system.c Thu Jul 19 16:28:37 2018 +0200 @@ -100,7 +100,11 @@ } int sys_mkdir(const char *path) { +#ifdef _WIN32 + return mkdir(path); +#else return mkdir(path, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); +#endif } #else @@ -111,7 +115,7 @@ size_t lenadd = dir ? 2 : 0; - wchar_t *wpath = calloc(len+lenadd, sizeof(wchar_t)); + wchar_t *wpath = calloc(len+lenadd+1, sizeof(wchar_t)); int wlen = MultiByteToWideChar( CP_UTF8, 0,