提交 58d0f4d7 编写于 作者: J Jiri Denemark

tests: Don't ignore return value of getcwd()

上级 5f5c6a1b
......@@ -97,7 +97,8 @@ int main(int argc, char **argv) {
fprintf(log, "DAEMON:%s\n", getppid() == 1 ? "yes" : "no");
char cwd[1024];
getcwd(cwd, sizeof(cwd));
if (!getcwd(cwd, sizeof(cwd)))
return EXIT_FAILURE;
if (strlen(cwd) > strlen("/commanddata") &&
STREQ(cwd + strlen(cwd) - strlen("/commanddata"), "/commanddata"))
strcpy(cwd, ".../commanddata");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册