about summary refs log tree commit diff stats
path: root/src/LYExtern.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/LYExtern.c')
-rw-r--r--src/LYExtern.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/LYExtern.c b/src/LYExtern.c
index e3d84275..cc7a41ea 100644
--- a/src/LYExtern.c
+++ b/src/LYExtern.c
@@ -254,11 +254,11 @@ void run_external ARGS1(char *, c)
 		    char e_buff[PATH_MAX], *p;
 
 		    p = c + 17;
+		    *e_buff = 0;
 		    if (strchr(p, ':') == NULL) {
-			sprintf(e_buff, "%s/%s", windows_drive, p);
-		    } else {
-			strcpy(e_buff, p);
+			sprintf(e_buff, "%.3s/", windows_drive);
 		    }
+		    strncat(e_buff, p, sizeof(e_buff) - strlen(e_buff) - 1);
 		    p = strrchr(e_buff, '.');
 		    if (p) {
 			p = strchr(p, '#');