diff --git a/test/main.c b/test/main.c index 20c0a0a..969b6ab 100644 --- a/test/main.c +++ b/test/main.c @@ -16,11 +16,11 @@ struct num { size_t line; int num; }; MIN_ARRAY(char, char) MIN_ARRAY(num, struct num) -/** Concatenates the contents after the file pointer of `fp` to `string`. Zeros - are preserved, as well as appending a null-terminator. @return Success, - otherwise `string` may have read a partial read and may not be terminated. - @throws[fread, malloc] */ -static int cat_fp_to_str(FILE *const fp, struct char_array *const string) { +/** Reads the contents of `fp` after the file pointer and copies them to + `string`; adds a null-terminator. + @return Success, otherwise `string` may have read a partial read and may not + be terminated. @throws[fread, malloc] */ +static int fp_to_str(FILE *const fp, struct char_array *const string) { const size_t granularity = 1024; size_t nread; char *cursor; @@ -44,7 +44,7 @@ int main(void) { char *a, *anum = 0; size_t i, line = 1 /* Unix: delimited by '\n'. */; errno = 0; /* In case we are running it as part of another editor. */ - if(!cat_fp_to_str(stdin, &str)) goto catch; + if(!fp_to_str(stdin, &str)) goto catch; /* It would be conceivable use the length to continue past the first sentinel '\0', but not that complex. */ fprintf(stderr, "Read:\n<<<%s>>>\n", str.data);