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

utils_intToText() issue #404

Closed
Kevin0626 opened this issue Nov 29, 2018 · 2 comments
Closed

utils_intToText() issue #404

Kevin0626 opened this issue Nov 29, 2018 · 2 comments

Comments

@Kevin0626
Copy link
Contributor

If passed number is 12345 and length is 6 , the returned buffer will contain"123455". This is because the last space keep the content before calling memmove. Although the returned value indicates the correct length which is 5 in this case, however the caller may ignore it. Just like the prv_getLocationString(), it will provide whole string "123455" regardless of the return length.

I would suggest to modify the utils_intToText() to ensure value zero is filled for the padding spaces. That avoid similar errors in the future.

@sbertin-telular
Copy link
Contributor

Have you found a case where the caller is ignoring it, or is this a usage in your own code? If wakaama is using it incorrectly, that usage should be corrected. To be clear, I have no objection to the change you propose but if there is a bug in wakaama I would like to see that fixed also.

@Kevin0626
Copy link
Contributor Author

prv_getLocationString() in wakamma actually ignored the return value. and I have a pr for the fix.

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