##// END OF EJS Templates
fuzz: fix an unused result on getcwd() in pyutil...
Augie Fackler -
r44259:c78f8f07 default
parent child Browse files
Show More
@@ -1,5 +1,6 b''
1 #include "pyutil.h"
1 #include "pyutil.h"
2
2
3 #include <iostream>
3 #include <string>
4 #include <string>
4
5
5 namespace contrib
6 namespace contrib
@@ -24,7 +25,11 b' void initpy(const char *cselfpath)'
24 auto pos = selfpath.rfind("/");
25 auto pos = selfpath.rfind("/");
25 if (pos == std::string::npos) {
26 if (pos == std::string::npos) {
26 char wd[8192];
27 char wd[8192];
27 getcwd(wd, 8192);
28 if (!getcwd(wd, 8192)) {
29 std::cerr << "Failed to call getcwd: errno " << errno
30 << std::endl;
31 exit(1);
32 }
28 pypath = std::string(wd) + subdir;
33 pypath = std::string(wd) + subdir;
29 } else {
34 } else {
30 pypath = selfpath.substr(0, pos) + subdir;
35 pypath = selfpath.substr(0, pos) + subdir;
General Comments 0
You need to be logged in to leave comments. Login now