X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gas%2Fread.c;h=8f93c2ba2b461a22440889e67875fb40a34275f4;hb=48e9cc84058771da089a2e8e652f70ac20a8fac0;hp=bf594f12a2dd3341998f63ab1a8e1bfaeea9a542;hpb=16d87673993dc1dba10cd86996a9b016af38da12;p=deliverable%2Fbinutils-gdb.git diff --git a/gas/read.c b/gas/read.c index bf594f12a2..8f93c2ba2b 100644 --- a/gas/read.c +++ b/gas/read.c @@ -1052,7 +1052,8 @@ read_a_source_file (const char *name) { char *s2 = s; - strncpy (original_case_string, s2, sizeof (original_case_string)); + strncpy (original_case_string, s2, + sizeof (original_case_string) - 1); original_case_string[sizeof (original_case_string) - 1] = 0; while (*s2) @@ -1331,8 +1332,7 @@ read_a_source_file (const char *name) new_length += 100; } - if (tmp_buf) - free (tmp_buf); + free (tmp_buf); /* We've "scrubbed" input to the preferred format. In the process we may have consumed the whole of the remaining @@ -1800,8 +1800,7 @@ s_comm_internal (int param, out: if (flag_mri) mri_comment_end (stop, stopc); - if (name != NULL) - free (name); + free (name); return symbolP; } @@ -1861,8 +1860,7 @@ s_mri_common (int small ATTRIBUTE_UNUSED) sym = symbol_find_or_make (name); c = restore_line_pointer (c); - if (alc != NULL) - free (alc); + free (alc); if (*input_line_pointer != ',') align = 0; @@ -2464,7 +2462,7 @@ bss_alloc (symbolS *symbolP, addressT size, unsigned int align) { bss_seg = subseg_new (".sbss", 1); seg_info (bss_seg)->bss = 1; - if (!bfd_set_section_flags (bss_seg, SEC_ALLOC)) + if (!bfd_set_section_flags (bss_seg, SEC_ALLOC | SEC_SMALL_DATA)) as_warn (_("error setting flags for \".sbss\": %s"), bfd_errmsg (bfd_get_error ())); } @@ -5810,11 +5808,10 @@ s_incbin (int x ATTRIBUTE_UNUSED) as_warn (_("truncated file `%s', %ld of %ld bytes read"), path, bytes, count); } -done: + done: if (binfile != NULL) fclose (binfile); - if (path) - free (path); + free (path); } /* .include -- include a file at this point. */ @@ -5874,7 +5871,7 @@ s_include (int arg ATTRIBUTE_UNUSED) free (path); path = filename; -gotit: + gotit: /* malloc Storage leak when file is found on path. FIXME-SOMEDAY. */ register_dependency (path); input_scrub_insert_file (path);