Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse_add_string #84

Closed
guoyunliang opened this issue Sep 6, 2017 · 1 comment
Closed

parse_add_string #84

guoyunliang opened this issue Sep 6, 2017 · 1 comment

Comments

@guoyunliang
Copy link

guoyunliang commented Sep 6, 2017

if (var == NULL) {
if (token) {
strncpy(var, token, strlen(token));
}
} else {
if (token) {
strcat(token, ",");
strncat(token, var, strlen(var));
}
if (token) {
strncpy(var, token, strlen(token));
}
}
上述代码中,var==NULL时,怎么还可以执行strncpy

@kongjian
Copy link
Member

这是错误用法 目前代码走不到这个分支 但是需要修复

@kongjian kongjian closed this as completed Jun 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants