Append a single byte to z[] */
| 269 | |
| 270 | /* Append a single byte to z[] */ |
| 271 | static 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 ",". |
no test coverage detected