From: Peter Johnson Date: Mon, 10 May 2004 05:35:53 +0000 (-0000) Subject: snprintf is not portable; use strcpy/strcat instead. X-Git-Tag: v0.4.0~50 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f973ee2c21d58927a920529db0f92f6b605872a2;p=yasm snprintf is not portable; use strcpy/strcat instead. svn path=/trunk/yasm/; revision=1115 --- diff --git a/modules/objfmts/elf/elf-objfmt.c b/modules/objfmts/elf/elf-objfmt.c index a8cb5956..405f977f 100644 --- a/modules/objfmts/elf/elf-objfmt.c +++ b/modules/objfmts/elf/elf-objfmt.c @@ -412,7 +412,6 @@ elf_objfmt_output_section(yasm_section *sect, /*@null@*/ void *d) /*@dependent@*/ /*@null@*/ elf_secthead *shead; long pos; char *relname; - unsigned int relname_len; const char *sectname; /* Don't output absolute sections into the section table */ @@ -467,9 +466,9 @@ elf_objfmt_output_section(yasm_section *sect, /*@null@*/ void *d) /* name the relocation section .rel.foo */ sectname = yasm_section_get_name(sect); - relname_len = strlen(sectname)+5; - relname = yasm_xmalloc(relname_len); - snprintf(relname, relname_len, ".rel%s", sectname); + relname = yasm_xmalloc(strlen(sectname)+5); + strcpy(relname, ".rel"); + strcat(relname, sectname); elf_secthead_set_rel_name(shead, elf_strtab_append_str(info->objfmt_elf->shstrtab, relname));