未验证 提交 50ac67e8 编写于 作者: O openharmony_ci 提交者: Gitee

!2541 【轻量级 PR】:update zh-cn/contribute/OpenHarmony-c-cpp-secure-coding-guide.md.

Merge pull request !2541 from Huang Wei/N/A
...@@ -2447,7 +2447,7 @@ size_t pathSize = 0; ...@@ -2447,7 +2447,7 @@ size_t pathSize = 0;
pathSize = (size_t)PATH_MAX; pathSize = (size_t)PATH_MAX;
if (VerifyPathSize(pathSize) == true) { if (VerifyPathSize(pathSize)) {
canonicalFilename = (char *)malloc(pathSize); canonicalFilename = (char *)malloc(pathSize);
if (canonicalFilename == NULL) { if (canonicalFilename == NULL) {
...@@ -2461,7 +2461,7 @@ if (realpathRes == NULL) { ...@@ -2461,7 +2461,7 @@ if (realpathRes == NULL) {
... // 错误处理 ... // 错误处理
} }
if (VerifyFile(realpathRes) == false) { if (VerifyFile(realpathRes)) {
... // 错误处理 ... // 错误处理
} }
...@@ -3101,7 +3101,7 @@ if (file == NULL) { ...@@ -3101,7 +3101,7 @@ if (file == NULL) {
} }
if (IS_ERR(file)) { if (IS_ERR(file)) {
printk("Error occured while opening file %s, exiting ...\n", MY_FILE); printk("Error occurred while opening file %s, exiting ...\n", MY_FILE);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册