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

Commit

Permalink
bin: Fix bug with refactor of jemAppendStrs causing empty classpath
Browse files Browse the repository at this point in the history
Fixes #4
#4
  • Loading branch information
wltjr committed Apr 4, 2018
1 parent 3439667 commit 0b4d7e9
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/output_formatter.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,16 @@ char *jemAddTermColor(char *msg) {
*/
char *jemAppendStrs(char* cur_str,char *sep_str,char *add_str) {
char *new_str = NULL;
if(cur_str && add_str) {
char *old_str = cur_str;
if(sep_str)
asprintf(&new_str,"%s%s%s",cur_str,sep_str,add_str);
else
asprintf(&new_str,"%s%s",cur_str,add_str);
free(old_str);
if(add_str) {
if(cur_str) {
char *old_str = cur_str;
if(sep_str)
asprintf(&new_str,"%s%s%s",cur_str,sep_str,add_str);
else
asprintf(&new_str,"%s%s",cur_str,add_str);
free(old_str);
} else
asprintf(&new_str,"%s",add_str);
}
return(new_str);
}
Expand Down

0 comments on commit 0b4d7e9

Please sign in to comment.