Skip to content

Commit 47d49c1

Browse files
Bug-fix with windows style of line end \r\n
1 parent c15b11c commit 47d49c1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include "string_table.h"
33
#include "options.h"
44

5-
#define VERSION_NAME "0.0.2"
5+
#define VERSION_NAME "0.0.3"
66

77
void print_version() {
88
printf("Table printer version: %s\n", VERSION_NAME);

string_table.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ string_table_t *get_string_table(options_t *options) {
3030
width++;
3131
continue;
3232
}
33-
if (input == '\n') {
34-
33+
if (input == '\n' || input == '\r') {
34+
if(buffer->length == 0) continue;
3535
add_string_to_array(line, buffer);
3636
buffer = create_string_empty(12);
3737
width++;

0 commit comments

Comments
 (0)