summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-09-10 10:44:59 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-09-10 10:44:59 -0700
commitee534667c6fc9a9b3364bb753f935d5a2f6a81e3 (patch)
tree5fd27be0e28907a0caa78f47a2f5311bf29edba1
parentbeb0876af6a532d32ae70675dcd882b2e9e55fc8 (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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/header.c b/header.c
index 45a92a1..f72461a 100644
--- a/header.c
+++ b/header.c
@@ -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)) {