*/
char *term_color_code(char *outbuf, int fgcolor, int bgcolor, int maxout);
-char *term_strip(char *outbuf, char *inbuf, int maxout);
+char *term_strip(char *outbuf, const char *inbuf, int maxout);
void term_filter_escapes(char *line);
int res = 0;
/* If no file pointer exists, skip it */
- if (!chan->fileptr)
+ if (!chan->fileptr) {
continue;
-
+ }
+
/* Print out to the file */
res = fprintf(chan->fileptr, "[%s] %s[%ld] %s: %s",
- logmsg->date, logmsg->level_name, logmsg->process_id, logmsg->file, logmsg->message);
+ logmsg->date, logmsg->level_name, logmsg->process_id, logmsg->file, term_strip(buf, logmsg->message, BUFSIZ));
if (res <= 0 && !ast_strlen_zero(logmsg->message)) {
fprintf(stderr, "**** Asterisk Logging Error: ***********\n");
if (errno == ENOMEM || errno == ENOSPC)
return outbuf;
}
-char *term_strip(char *outbuf, char *inbuf, int maxout)
+char *term_strip(char *outbuf, const char *inbuf, int maxout)
{
- char *outbuf_ptr = outbuf, *inbuf_ptr = inbuf;
+ char *outbuf_ptr = outbuf;
+ const char *inbuf_ptr = inbuf;
while (outbuf_ptr < outbuf + maxout) {
switch (*inbuf_ptr) {