implement Nikola's idea to remove limit number of strings in errmsg
This commit is contained in:
20
buffer/errmsg_write.c
Normal file
20
buffer/errmsg_write.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <stdarg.h>
|
||||
#include "errmsg.h"
|
||||
#include "errmsg_int.h"
|
||||
|
||||
void errmsg_write(int fd,const char* err,const char* message,va_list list) {
|
||||
errmsg_start(fd);
|
||||
errmsg_puts(fd,message);
|
||||
for (;;) {
|
||||
const char* s=va_arg(list,const char*);
|
||||
if (!s) break;
|
||||
errmsg_puts(fd,s);
|
||||
}
|
||||
va_end(list);
|
||||
if (err) {
|
||||
errmsg_puts(fd,": ");
|
||||
errmsg_puts(fd,err);
|
||||
}
|
||||
errmsg_puts(fd,"\n");
|
||||
errmsg_flush(fd);
|
||||
}
|
||||
Reference in New Issue
Block a user