mirror of
https://github.com/nikdoof/dhsd.git
synced 2025-12-19 22:09:21 +00:00
v0.0.1
This commit is contained in:
17
dprintf.c
Normal file
17
dprintf.c
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define BUFLEN 4096
|
||||
|
||||
void dprintf(int fd, char *format, ...)
|
||||
{
|
||||
va_list arglist;
|
||||
char buffer[BUFLEN];
|
||||
|
||||
va_start(arglist, format);
|
||||
vsnprintf(buffer, BUFLEN, format, arglist);
|
||||
va_end(arglist);
|
||||
|
||||
write(fd, buffer, strlen(buffer));
|
||||
}
|
||||
Reference in New Issue
Block a user