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

Function add_byte

scripts/config/confdata.c:290–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

288
289#define LINE_GROWTH 16
290static int add_byte(int c, char **lineptr, size_t slen, size_t *n)
291{
292 char *nline;
293 size_t new_size = slen + 1;
294 if (new_size > *n) {
295 new_size += LINE_GROWTH - 1;
296 new_size *= 2;
297 nline = xrealloc(*lineptr, new_size);
298 if (!nline)
299 return -1;
300
301 *lineptr = nline;
302 *n = new_size;
303 }
304
305 (*lineptr)[slen] = c;
306
307 return 0;
308}
309
310static ssize_t compat_getline(char **lineptr, size_t *n, FILE *stream)
311{

Callers 1

compat_getlineFunction · 0.85

Calls 1

xreallocFunction · 0.85

Tested by

no test coverage detected