003 File Manager
Current Path:
/usr/src/contrib/libpcap/missing
usr
/
src
/
contrib
/
libpcap
/
missing
/
📁
..
📄
asprintf.c
(2.96 KB)
📄
getopt.c
(3.92 KB)
📄
getopt.h
(252 B)
📄
snprintf.c
(12.74 KB)
📄
strlcat.c
(1.8 KB)
📄
strlcpy.c
(1.66 KB)
📄
strtok_r.c
(2.65 KB)
📄
win_asprintf.c
(919 B)
📄
win_snprintf.c
(1.09 KB)
Editing: win_asprintf.c
#include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include "portability.h" int pcap_vasprintf(char **strp, const char *format, va_list args) { int len; size_t str_size; char *str; int ret; len = _vscprintf(format, args); if (len == -1) { *strp = NULL; return (-1); } str_size = len + 1; str = malloc(str_size); if (str == NULL) { *strp = NULL; return (-1); } ret = pcap_vsnprintf(str, str_size, format, args); if (ret == -1) { free(str); *strp = NULL; return (-1); } *strp = str; /* * pcap_vsnprintf() shouldn't truncate the string, as we have * allocated a buffer large enough to hold the string, so its * return value should be the number of characters printed. */ return (ret); } int pcap_asprintf(char **strp, const char *format, ...) { va_list args; int ret; va_start(args, format); ret = pcap_vasprintf(strp, format, args); va_end(args); return (ret); }
Upload File
Create Folder