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

Avoid using sizeof('\0') to compute size for NUL-terminator. #277

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fstromback
Copy link
Contributor

The expression sizeof('\0') evaluates to sizeof(int), which does not reflect the intent in the code. It has been replaced with 1 /* NUL */ for clarity.

This issue was originally reported by наб [email protected] who also proposed this patch.

Fixes #276

The expression `sizeof('\0')` evaluates to `sizeof(int)`, which does not reflect
the intent in the code. It has been replaced with `1 /* NUL */` for clarity.

This issue was originally reported by наб <[email protected]>
who also proposed this patch.
@thejayps thejayps added the essential Will cause failure to meet customer requirements. Assign resources. label Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
essential Will cause failure to meet customer requirements. Assign resources.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Usage of sizeof('\0') for computing the size of string terminators
2 participants