Skip to content

Commit 00d1e82

Browse files
committed
Avoid implicit conversion
Use auto to avoid implicit type conversion, hiding possible value truncation.
1 parent 28e95b3 commit 00d1e82

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/patchelf.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ ElfFile<ElfFileParamNames>::ElfFile(FileContents fContents)
290290
/* Get the section header string table section (".shstrtab"). Its
291291
index in the section header table is given by e_shstrndx field
292292
of the ELF header. */
293-
unsigned int shstrtabIndex = rdi(hdr()->e_shstrndx);
293+
auto shstrtabIndex = rdi(hdr()->e_shstrndx);
294294
if (shstrtabIndex >= shdrs.size())
295295
error("string table index out of bounds");
296296

297-
unsigned int shstrtabSize = rdi(shdrs[shstrtabIndex].sh_size);
297+
auto shstrtabSize = rdi(shdrs[shstrtabIndex].sh_size);
298298
char * shstrtab = (char * ) fileContents->data() + rdi(shdrs[shstrtabIndex].sh_offset);
299299
checkPointer(fileContents, shstrtab, shstrtabSize);
300300

0 commit comments

Comments
 (0)