From 55098136dc3bf1885fcc79ab176b2c5c89fa8914 Mon Sep 17 00:00:00 2001 From: Mis012 Date: Wed, 21 Jun 2023 18:33:30 +0200 Subject: [PATCH] src/main-executable/main.c: fix possible stray : at the end of classpath apparently this can cause a crash in art --- src/main-executable/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main-executable/main.c b/src/main-executable/main.c index de28320b..0783aea4 100644 --- a/src/main-executable/main.c +++ b/src/main-executable/main.c @@ -59,12 +59,14 @@ char *construct_classpath(char *prefix, char **cp_array, size_t len) strcpy(result, prefix); for(int i = 0; i < len; i++) { if(cp_array[i]) { - strcat(result, cp_array[i]); - if (i < (len - 1)) + if (i > 0) strcat(result, ":"); + strcat(result, cp_array[i]); } } + printf("construct_classpath: returning >%s<\n", result); + return result; }