Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Commit 0b4d7e9

Browse files
committed
bin: Fix bug with refactor of jemAppendStrs causing empty classpath
Fixes #4 #4
1 parent 3439667 commit 0b4d7e9

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/output_formatter.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,16 @@ char *jemAddTermColor(char *msg) {
118118
*/
119119
char *jemAppendStrs(char* cur_str,char *sep_str,char *add_str) {
120120
char *new_str = NULL;
121-
if(cur_str && add_str) {
122-
char *old_str = cur_str;
123-
if(sep_str)
124-
asprintf(&new_str,"%s%s%s",cur_str,sep_str,add_str);
125-
else
126-
asprintf(&new_str,"%s%s",cur_str,add_str);
127-
free(old_str);
121+
if(add_str) {
122+
if(cur_str) {
123+
char *old_str = cur_str;
124+
if(sep_str)
125+
asprintf(&new_str,"%s%s%s",cur_str,sep_str,add_str);
126+
else
127+
asprintf(&new_str,"%s%s",cur_str,add_str);
128+
free(old_str);
129+
} else
130+
asprintf(&new_str,"%s",add_str);
128131
}
129132
return(new_str);
130133
}

0 commit comments

Comments
 (0)