Skip to content

Commit 47e75d0

Browse files
committed
Hopefully fix the build for tadzik++.
1 parent c1c6435 commit 47e75d0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

3rdparty/dyncall/dynload/dynload_syms_elf.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ DLSyms* dlSymsInit(const char* libPath)
106106
int i;
107107
struct stat st;
108108
DLSyms* pSyms = (DLSyms*)dlAllocMem(sizeof(DLSyms));
109+
Elf_Shdr* pS;
109110
memset(pSyms, 0, sizeof(DLSyms));
110111
pSyms->file = open(libPath, O_RDONLY);
111112
stat(libPath, &st);
@@ -125,7 +126,7 @@ DLSyms* dlSymsInit(const char* libPath)
125126
pMem = (unsigned char*)pSyms->pElf_Ehdr;
126127

127128
/* traverse section headers */
128-
Elf_Shdr* pS = (Elf_Shdr*) ( pMem + pSyms->pElf_Ehdr->e_shoff );
129+
pS = (Elf_Shdr*) ( pMem + pSyms->pElf_Ehdr->e_shoff );
129130
/* skip section 0 which is always zero due to the Elf standard. */
130131
for (i = 1; i < pSyms->pElf_Ehdr->e_shnum; i++)
131132
{
@@ -169,10 +170,12 @@ int dlSymsCount(DLSyms* pSyms)
169170

170171
const char* dlSymsName(DLSyms* pSyms, int index)
171172
{
173+
int str_index;
174+
172175
if(!pSyms || !pSyms->pSymTab || index < 0 || index >= pSyms->nSymbols)
173176
return NULL;
174-
175-
int str_index = pSyms->pSymTab[index].st_name;
177+
178+
str_index = pSyms->pSymTab[index].st_name;
176179
if (str_index < 0 || str_index >= pSyms->strTabSize)
177180
return NULL;
178181
return &pSyms->pStrTab[str_index];

0 commit comments

Comments
 (0)