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

doxygen2man: Fix a couple of covscan-detected errors #425

Merged
merged 2 commits into from
Oct 22, 2020

Conversation

chrissie-c
Copy link
Contributor

No description provided.

doxygen2man/doxygen2man.c Outdated Show resolved Hide resolved
Copy link
Contributor

@wferi wferi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't strnlen() be simpler? Or isn't it portable enough?

@chrissie-c
Copy link
Contributor Author

I have to admit, I'd not even heard of strnlen() thanks!

for (i=0; i< len; i++) {
buffer[i] = toupper(name[i]);
}
buffer[len] = '\0';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW you can also shave off the len declaration by using buffer[i] = 0 here (if this is your thing). :)

@chrissie-c
Copy link
Contributor Author

Fair point, but I think using len is clearer :)

@kgaillot
Copy link
Contributor

looks good to me

@chrissie-c chrissie-c merged commit c2dfe66 into ClusterLabs:master Oct 22, 2020
@chrissie-c chrissie-c deleted the covscan-doxy-fixes branch October 22, 2020 07:17
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

Successfully merging this pull request may close these issues.

3 participants