mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-10 02:43:34 +08:00
Use LD_PATHMAX+1 to account for trailing '\0'.
This commit is contained in:
parent
a08a0d635b
commit
2a8ac465c4
@ -1,3 +1,8 @@
|
||||
2002-12-17 Danny Smith <dannysmith@users.sourceforge.net>
|
||||
|
||||
* emultempl/pe.em (..._recognized_file): Use LD_PATHMAX+1 to
|
||||
account for trailing '\0'.
|
||||
|
||||
2002-12-17 Nick Clifton <nickc@redhat.com>
|
||||
|
||||
* emultempl/pe.em (longopts): Duplicate entry for --compact-implib
|
||||
|
@ -1392,11 +1392,11 @@ gld_${EMULATION_NAME}_recognized_file (entry)
|
||||
#endif
|
||||
if (bfd_get_format (entry->the_bfd) == bfd_object)
|
||||
{
|
||||
char fbuf[LD_PATHMAX];
|
||||
char fbuf[LD_PATHMAX + 1];
|
||||
const char *ext;
|
||||
|
||||
if (REALPATH (entry->filename, fbuf) == NULL)
|
||||
strncpy (fbuf, entry->filename, LD_PATHMAX);
|
||||
strncpy (fbuf, entry->filename, sizeof (fbuf));
|
||||
|
||||
ext = fbuf + strlen (fbuf) - 4;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user