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

Usage of sizeof instead of strlen #1

Open
xHire opened this issue Mar 31, 2018 · 0 comments
Open

Usage of sizeof instead of strlen #1

xHire opened this issue Mar 31, 2018 · 0 comments

Comments

@xHire
Copy link

xHire commented Mar 31, 2018

char tmp[sizeof(home) + 30];

In a brief skim through I found this issue. I’d recommend using alloca to allocate on stack if you want to avoid dynamic allocation on heap. sizeof is a compile-time construct so it won’t work here the intended way. :c)

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

1 participant