aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorDavid MacKenzie <djm@cygnus>1993-07-12 19:34:04 +0000
committerDavid MacKenzie <djm@cygnus>1993-07-12 19:34:04 +0000
commitd723cd17d5f3e2db2f32bee905f0632fba4389cf (patch)
treecce2685fc61e3258c59075f532f2f9cccf8d25d2 /ld/ldlang.c
parentc463189d53ecb9e66bf07f587a22b482aecc3242 (diff)
downloadgdb-d723cd17d5f3e2db2f32bee905f0632fba4389cf.zip
gdb-d723cd17d5f3e2db2f32bee905f0632fba4389cf.tar.gz
gdb-d723cd17d5f3e2db2f32bee905f0632fba4389cf.tar.bz2
* ldlang.c (lang_process): Use sizeof instead of magic constant.
* ldmain.c (get_emulation, check_for_scripts_dir, set_scripts_dir): New functions. (main): Call them.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index b53a2fa..e2e8d5f 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -2449,7 +2449,8 @@ lang_process ()
{
/* Read the emulation's appropriate default script. */
char *scriptname = ldemul_get_script ();
- size_t size = strlen (scriptname) + 13;
+ /* sizeof counts the terminating NUL. */
+ size_t size = strlen (scriptname) + sizeof ("-Tldscripts/");
char *buf = (char *) ldmalloc(size);
sprintf (buf, "-Tldscripts/%s", scriptname);