From f973ee2c21d58927a920529db0f92f6b605872a2 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 10 May 2004 05:35:53 +0000 Subject: [PATCH] snprintf is not portable; use strcpy/strcat instead. svn path=/trunk/yasm/; revision=1115 --- modules/objfmts/elf/elf-objfmt.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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)); -- 2.40.0