fix: print error on stderr
This commit is contained in:
@ -2,14 +2,15 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void print_err(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
puts("ft_ping: ");
|
||||
dprintf(2, "ft_ping: ");
|
||||
va_start(args, format);
|
||||
vprintf(format, args);
|
||||
vdprintf(2, format, args);
|
||||
va_end(args);
|
||||
putchar('\n');
|
||||
write(2, "\n", 1);
|
||||
}
|
||||
Reference in New Issue
Block a user