MCPcopy Create free account
hub / github.com/coreboot/coreboot / add_byte

Function add_byte

util/kconfig/confdata.c:318–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316
317#define LINE_GROWTH 16
318static int add_byte(int c, char **lineptr, size_t slen, size_t *n)
319{
320 size_t new_size = slen + 1;
321
322 if (new_size > *n) {
323 new_size += LINE_GROWTH - 1;
324 new_size *= 2;
325 *lineptr = xrealloc(*lineptr, new_size);
326 *n = new_size;
327 }
328
329 (*lineptr)[slen] = c;
330
331 return 0;
332}
333
334static ssize_t compat_getline(char **lineptr, size_t *n, FILE *stream)
335{

Callers 1

compat_getlineFunction · 0.70

Calls 1

xreallocFunction · 0.85

Tested by

no test coverage detected