/* read.c - read a source file -
- Copyright (C) 1986-2019 Free Software Foundation, Inc.
+ Copyright (C) 1986-2020 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
{
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)
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
out:
if (flag_mri)
mri_comment_end (stop, stopc);
- if (name != NULL)
- free (name);
+ free (name);
return symbolP;
}
sym = symbol_find_or_make (name);
c = restore_line_pointer (c);
- if (alc != NULL)
- free (alc);
+ free (alc);
if (*input_line_pointer != ',')
align = 0;
{
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 ()));
}
bump_line_counters ();
break;
-#ifndef NO_STRING_ESCAPES
case '\\':
+ if (!TC_STRING_ESCAPES)
+ break;
switch (c = *input_line_pointer++ & CHAR_MASK)
{
case 'b':
break;
}
break;
-#endif /* ! defined (NO_STRING_ESCAPES) */
default:
break;
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. */
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);