Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 236f62d

Browse files
committed
Corrections to aix_loaderror(), by Manus Hand.
1 parent f215060 commit 236f62d

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

Python/importdl.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ load_dynamic_module(name, pathname, fp)
493493
void aix_loaderror(char *pathname)
494494
{
495495

496-
char *message[8], errbuf[1024];
496+
char *message[1024], errbuf[1024];
497497
int i,j;
498498

499499
struct errtab {
@@ -509,7 +509,7 @@ void aix_loaderror(char *pathname)
509509
{L_ERROR_MEMBER,
510510
"file not an archive or does not contain requested member:"},
511511
{L_ERROR_TYPE, "symbol table mismatch:"},
512-
{L_ERROR_ALIGN, "text allignment in file is wrong."},
512+
{L_ERROR_ALIGN, "text alignment in file is wrong."},
513513
{L_ERROR_SYSTEM, "System error:"},
514514
{L_ERROR_ERRNO, NULL}
515515
};
@@ -519,13 +519,15 @@ void aix_loaderror(char *pathname)
519519

520520
sprintf(errbuf, " from module %.200s ", pathname);
521521

522-
if (!loadquery(1, &message[0], sizeof(message)))
522+
if (!loadquery(1, &message[0], sizeof(message))) {
523523
ERRBUF_APPEND(strerror(errno));
524+
ERRBUF_APPEND("\n");
525+
}
524526
for(i = 0; message[i] && *message[i]; i++) {
525527
int nerr = atoi(message[i]);
526528
for (j=0; j<LOAD_ERRTAB_LEN ; j++) {
527-
if (nerr == load_errtab[i].errno && load_errtab[i].errstr)
528-
ERRBUF_APPEND(load_errtab[i].errstr);
529+
if (nerr == load_errtab[j].errno && load_errtab[j].errstr)
530+
ERRBUF_APPEND(load_errtab[j].errstr);
529531
}
530532
while (isdigit(*message[i])) message[i]++ ;
531533
ERRBUF_APPEND(message[i]);

0 commit comments

Comments
 (0)