MCPcopy Index your code
hub / github.com/RsyncProject/rsync / vasprintf

Function vasprintf

lib/snprintf.c:1241–1259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1239
1240#ifndef HAVE_VASPRINTF
1241 int vasprintf(char **ptr, const char *format, va_list ap)
1242{
1243 int ret;
1244 va_list ap2;
1245
1246 VA_COPY(ap2, ap);
1247 ret = vsnprintf(NULL, 0, format, ap2);
1248 va_end(ap2);
1249 if (ret < 0) return ret;
1250
1251 (*ptr) = (char *)malloc(ret+1);
1252 if (!*ptr) return -1;
1253
1254 VA_COPY(ap2, ap);
1255 ret = vsnprintf(*ptr, ret+1, format, ap2);
1256 va_end(ap2);
1257
1258 return ret;
1259}
1260#endif
1261
1262

Callers 2

asprintfFunction · 0.85
POPT_fprintfFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected