diff options
| author | Evan Lojewski <github@meklort.com> | 2021-02-06 16:29:58 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-06 16:29:58 -0700 |
| commit | a1b8330b2506ffa6a30bfc4153149b9184ea76cf (patch) | |
| tree | f503723aebe715a0acd1eba2d6ba066f3fe53754 /utils/ape2elf/main.cpp | |
| parent | af7847795c9096067c976901a6149350534ae42c (diff) | |
| download | bcm5719-ortega-a1b8330b2506ffa6a30bfc4153149b9184ea76cf.tar.gz bcm5719-ortega-a1b8330b2506ffa6a30bfc4153149b9184ea76cf.zip | |
build: Fix a number of compiler issues when building utils with gcc. (#208)
Diffstat (limited to 'utils/ape2elf/main.cpp')
| -rw-r--r-- | utils/ape2elf/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/ape2elf/main.cpp b/utils/ape2elf/main.cpp index 7daa80a..355ca37 100644 --- a/utils/ape2elf/main.cpp +++ b/utils/ape2elf/main.cpp @@ -95,7 +95,7 @@ int main(int argc, char const *argv[]) if (ape.words[0] == be32toh(APE_HEADER_MAGIC)) { // The file is swapped... fix it. - for (int i = 0; i < sizeof(ape) / sizeof(ape.words[0]); i++) + for (size_t i = 0; i < sizeof(ape) / sizeof(ape.words[0]); i++) { ape.words[i] = be32toh(ape.words[i]); } @@ -151,7 +151,7 @@ int main(int argc, char const *argv[]) printf("UNK0: 0x%08X\n", ape.header.unk0); char name[sizeof(ape.header.name) + 1] = { 0 }; - strncpy(name, (char *)ape.header.name, sizeof(ape.header.name)); + strncpy(name, (char *)ape.header.name, sizeof(name) - 1); printf("Name: %s\n", name); printf("Version: 0x%08X (%d.%d.%d)\n", ape.header.version, version_major, version_minor, version_patch); printf("Start: 0x%08X\n", ape.header.entrypoint); |

