diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-09-10 10:44:59 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-09-10 10:44:59 -0700 |
commit | ee534667c6fc9a9b3364bb753f935d5a2f6a81e3 (patch) | |
tree | 5fd27be0e28907a0caa78f47a2f5311bf29edba1 | |
parent | beb0876af6a532d32ae70675dcd882b2e9e55fc8 (diff) |
Store strlen() results in size_t instead of unsigned int
Avoids truncating to 32-bits just to re-expand to 64-bits when
passing the value to strncmp() later
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | header.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -71,10 +71,10 @@ FindStringProperty(const char *propName, unsigned char *propData) { FSPropOffset *propOffset; - unsigned int length; + size_t length; propOffset = &propOffsets[0]; - length = (unsigned int) strlen(propName); + length = strlen(propName); for (unsigned int i = propInfo->num_offsets; i--; propOffset++) { if (propOffset->type == PropTypeString) { @@ -108,10 +108,10 @@ FindNumberProperty(const char *propName, unsigned char *propData) { FSPropOffset *propOffset; - unsigned int length; + size_t length; propOffset = &propOffsets[0]; - length = (unsigned int) strlen(propName); + length = strlen(propName); for (unsigned int i = propInfo->num_offsets; i--; propOffset++) { if ((propOffset->type == PropTypeSigned) || (propOffset->type == PropTypeUnsigned)) { |