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

Function getline_stripped

util/kconfig/confdata.c:369–386  ·  view source on GitHub ↗

like getline(), but the newline character is stripped away */

Source from the content-addressed store, hash-verified

367
368/* like getline(), but the newline character is stripped away */
369static ssize_t getline_stripped(char **lineptr, size_t *n, FILE *stream)
370{
371 ssize_t len;
372
373 len = compat_getline(lineptr, n, stream);
374
375 if (len > 0 && (*lineptr)[len - 1] == '\n') {
376 len--;
377 (*lineptr)[len] = '\0';
378
379 if (len > 0 && (*lineptr)[len - 1] == '\r') {
380 len--;
381 (*lineptr)[len] = '\0';
382 }
383 }
384
385 return len;
386}
387
388int conf_read_simple(const char *name, int def)
389{

Callers 1

conf_read_simpleFunction · 0.85

Calls 1

compat_getlineFunction · 0.85

Tested by

no test coverage detected