Fix mach0 regression introduced in 081ba8343

This commit is contained in:
pancake 2015-11-18 11:40:34 +01:00
parent 95791f76c2
commit b35b830446

View File

@ -919,7 +919,7 @@ static int prot2perm (int x) {
struct section_t* MACH0_(get_sections)(struct MACH0_(obj_t)* bin) {
struct section_t *sections;
char segname[17], sectname[17];
char segname[32], sectname[32];
int i, j, to;
if (!bin || !bin->sects)
@ -939,7 +939,6 @@ struct section_t* MACH0_(get_sections)(struct MACH0_(obj_t)* bin) {
r_str_ncpy (sectname, bin->sects[i].sectname, sizeof (sectname)-1);
// hack to support multiple sections with same name
// ensure '\0' terminated
bin->sects[i].sectname[15] = '\0';
snprintf (segname, sizeof (segname), "%d", i); // wtf
snprintf (sectname, sizeof (sectname), "%s", bin->sects[i].sectname);
for (j=0; j<bin->nsegs; j++) {