Skip to content

Commit

Permalink
This should always place something in between
Browse files Browse the repository at this point in the history
  • Loading branch information
vmcj committed Jan 24, 2022
1 parent d3b78e3 commit a1dd318
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/lib.error.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,14 @@ void vlogmsg(int msglevel, const char *mesg, va_list ap)
bufferlen = strlen(timestring)+strlen(progname_escaped)+strlen(mesg)+20;
buffer = (char *)malloc(bufferlen);
if ( buffer==NULL ) abort();
progname_unformatted = (char *)malloc(1+strlen(progname_escaped));
progname_unformatted = (char *)malloc(1+2*strlen(progname_escaped));
size_t str_tmp_pos, esc_tmp_pos;
char ctmp;
for(str_tmp_pos=0; str_tmp_pos<strlen(progname_escaped); str_tmp_pos++) {
ctmp = progname_escaped[str_tmp_pos];
if ( ctmp!='%' ) {
progname_unformatted[esc_tmp_pos++] = 'c';
progname_unformatted[esc_tmp_pos++] = ctmp;
}
}
progname_unformatted[esc_tmp_pos] = 0;
Expand Down

0 comments on commit a1dd318

Please sign in to comment.