Skip to content

Commit

Permalink
Merge pull request #25 from KhoraLee/fix/deviceModel
Browse files Browse the repository at this point in the history
fix: Change len value to make string not truncated
  • Loading branch information
JoseMoreville authored Aug 30, 2022
2 parents 046b688 + 25f9eca commit 5a28d3e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions PlayTools/PlayLoader.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ static int my_sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void *
int ret = sysctlbyname(name, oldp, oldlenp, newp, newlen);
const char *mechine = DEVICE_MODEL;
strncpy((char *)oldp, mechine, strlen(mechine));
*oldlenp = strlen(mechine);
return ret;
} else {
int ret = sysctlbyname(name, oldp, oldlenp, newp, newlen);
Expand All @@ -100,6 +101,7 @@ static int my_sysctlbyname(const char *name, void *oldp, size_t *oldlenp, void *
int ret = sysctlbyname(name, oldp, oldlenp, newp, newlen);
const char *mechine = OEM_ID;
strncpy((char *)oldp, mechine, strlen(mechine));
*oldlenp = strlen(mechine);
return ret;
} else {
int ret = sysctlbyname(name, oldp, oldlenp, newp, newlen);
Expand Down

0 comments on commit 5a28d3e

Please sign in to comment.