forked from pool/boinc-client
f69864460a
Update + systemd support. Build fail with 12.3 and 12.2 but I'm not a dev and can't fix it OBS-URL: https://build.opensuse.org/request/show/204854 OBS-URL: https://build.opensuse.org/package/show/network/boinc-client?expand=0&rev=32
42 lines
1022 B
Diff
42 lines
1022 B
Diff
Index: lib/filesys.cpp
|
|
===================================================================
|
|
--- lib/filesys.cpp.orig
|
|
+++ lib/filesys.cpp
|
|
@@ -47,6 +47,7 @@
|
|
#include <sys/time.h>
|
|
#include <unistd.h>
|
|
#include <dirent.h>
|
|
+#include <climits>
|
|
|
|
#if HAVE_SYS_RESOURCE_H
|
|
#include <sys/resource.h>
|
|
@@ -412,7 +413,8 @@
|
|
} while (FindNextFileA(hFind, &findData));
|
|
::FindClose(hFind);
|
|
#else
|
|
- char filename[1024], subdir[1024];
|
|
+ char filename[PATH_MAX];
|
|
+ char *subdir;;
|
|
int retval=0;
|
|
DIRREF dirp;
|
|
double x;
|
|
@@ -423,7 +425,7 @@
|
|
while (1) {
|
|
retval = dir_scan(filename, dirp, sizeof(filename));
|
|
if (retval) break;
|
|
- sprintf(subdir, "%s/%s", dirpath, filename);
|
|
+ asprintf(&subdir, "%s/%s", dirpath, filename);
|
|
|
|
if (is_dir(subdir)) {
|
|
if (recurse) {
|
|
@@ -436,6 +438,9 @@
|
|
if (retval) continue;
|
|
size += x;
|
|
}
|
|
+
|
|
+ if(subdir != NULL)
|
|
+ free(subdir);
|
|
}
|
|
dir_close(dirp);
|
|
#endif
|