Skip to content

Commit a1dd318

Browse files
committed
This should always place something in between
1 parent d3b78e3 commit a1dd318

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/lib.error.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,14 @@ void vlogmsg(int msglevel, const char *mesg, va_list ap)
113113
bufferlen = strlen(timestring)+strlen(progname_escaped)+strlen(mesg)+20;
114114
buffer = (char *)malloc(bufferlen);
115115
if ( buffer==NULL ) abort();
116-
progname_unformatted = (char *)malloc(1+strlen(progname_escaped));
116+
progname_unformatted = (char *)malloc(1+2*strlen(progname_escaped));
117117
size_t str_tmp_pos, esc_tmp_pos;
118118
char ctmp;
119119
for(str_tmp_pos=0; str_tmp_pos<strlen(progname_escaped); str_tmp_pos++) {
120120
ctmp = progname_escaped[str_tmp_pos];
121121
if ( ctmp!='%' ) {
122122
progname_unformatted[esc_tmp_pos++] = 'c';
123+
progname_unformatted[esc_tmp_pos++] = ctmp;
123124
}
124125
}
125126
progname_unformatted[esc_tmp_pos] = 0;

0 commit comments

Comments
 (0)