]> granicus.if.org Git - yasm/commitdiff
snprintf is not portable; use strcpy/strcat instead.
authorPeter Johnson <peter@tortall.net>
Mon, 10 May 2004 05:35:53 +0000 (05:35 -0000)
committerPeter Johnson <peter@tortall.net>
Mon, 10 May 2004 05:35:53 +0000 (05:35 -0000)
svn path=/trunk/yasm/; revision=1115

modules/objfmts/elf/elf-objfmt.c

index a8cb595682fc62c219425c165d705328e9b4e595..405f977f4b01945a2310e399e2addfc91bb6c7b4 100644 (file)
@@ -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));