MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / csv_append_char

Function csv_append_char

lua/sp.c:271–282  ·  view source on GitHub ↗

Append a single byte to z[] */

Source from the content-addressed store, hash-verified

269
270/* Append a single byte to z[] */
271static void csv_append_char(CSVReader *p, int c)
272{
273 if (p->n + 1 >= p->nAlloc) {
274 p->nAlloc += p->nAlloc + 100;
275 p->z = realloc(p->z, p->nAlloc);
276 if (p->z == 0) {
277 logmsg(LOGMSG_FATAL, "out of memory\n");
278 exit(1);
279 }
280 }
281 p->z[p->n++] = (char)c;
282}
283
284/* Read a single field of CSV text. Compatible with rfc4180 and extended
285** with the option of having a separator other than ",".

Callers 3

csv_read_one_fieldFunction · 0.85
db_csvcopyFunction · 0.85
db_csv_to_tableFunction · 0.85

Calls 3

reallocFunction · 0.85
exitFunction · 0.85
logmsgFunction · 0.50

Tested by

no test coverage detected