diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2025-07-12 12:28:57 -0400 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2025-07-12 12:28:57 -0400 |
| commit | 62c324f89216da1c311c8225f6c9087e441734de (patch) | |
| tree | 89b60475d217bb1bbc9de91d43b243055124b2e5 /src | |
| parent | Remove unnecesary if statement and fix memset (diff) | |
| download | cli-62c324f89216da1c311c8225f6c9087e441734de.zip | |
Simplify justify function and add additional read_word test
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 6 |
1 files changed, 0 insertions, 6 deletions
@@ -50,12 +50,6 @@ int justify(size_t linebuffer_capacity, FILE *in, FILE *out) { while ((read_word_result = read_word(in, word, MAX_WORD_LENGTH + 1)) == READ_WORD_SUCCESS) { - word_length = strlen(word); - if (word_length == 0) { - linebuffer_write(lb, out); - linebuffer_destroy(lb); - return EXIT_SUCCESS; - } if (!linebuffer_append_word(lb, word)) { linebuffer_write_justified(lb, out); linebuffer_clear(lb); |