diff options
Diffstat (limited to 'src/common/stdin.c')
-rw-r--r-- | src/common/stdin.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/stdin.c b/src/common/stdin.c index a460247..c4bf746 100644 --- a/src/common/stdin.c +++ b/src/common/stdin.c @@ -14,11 +14,15 @@ // splitted in single file to make it easier to test char* -bc_stdin_read(void) +bc_stdin_read(size_t *len) { + if (len == NULL) + return NULL; + int c; bc_string_t *rv = bc_string_new(); while (EOF != (c = fgetc(stdin))) bc_string_append_c(rv, c); + *len = rv->len; return bc_string_free(rv, false); } |