diff --git a/zh-cn/contribute/OpenHarmony-c-cpp-secure-coding-guide.md b/zh-cn/contribute/OpenHarmony-c-cpp-secure-coding-guide.md index 6807bac1c98a52d7ded4b0049a0c43e933894268..eb25d94f33dc08adeb1c564a88aef39fd1279397 100644 --- a/zh-cn/contribute/OpenHarmony-c-cpp-secure-coding-guide.md +++ b/zh-cn/contribute/OpenHarmony-c-cpp-secure-coding-guide.md @@ -2447,7 +2447,7 @@ size_t pathSize = 0; pathSize = (size_t)PATH_MAX; -if (VerifyPathSize(pathSize) == true) { +if (VerifyPathSize(pathSize)) { canonicalFilename = (char *)malloc(pathSize); if (canonicalFilename == NULL) { @@ -2461,7 +2461,7 @@ if (realpathRes == NULL) { ... // 错误处理 } -if (VerifyFile(realpathRes) == false) { +if (VerifyFile(realpathRes)) { ... // 错误处理 } @@ -3101,7 +3101,7 @@ if (file == NULL) { } 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; }