From 2742cb14ce02354f6c9a2a2a61f793f9a1932924 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Sat, 16 Sep 2000 18:57:45 +0000 Subject: 12814: zasprintf --- Src/init.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Src/init.c') diff --git a/Src/init.c b/Src/init.c index e3e8f734e..0c82e47ef 100644 --- a/Src/init.c +++ b/Src/init.c @@ -1020,18 +1020,22 @@ source(char *s) void sourcehome(char *s) { - char buf[PATH_MAX]; + char *buf; char *h; if (emulation == EMULATE_SH || emulation == EMULATE_KSH || !(h = getsparam("ZDOTDIR"))) h = home; +/* Let source() complain if it's too long */ +#if 0 if (strlen(h) + strlen(s) + 1 >= PATH_MAX) { zerr("path too long: %s", s, 0); return; } - sprintf(buf, "%s/%s", h, s); +#endif + zasprintf(&buf, "%s/%s", h, s); source(buf); + zsfree(buf); } /**/ -- cgit 1.4.1