From fe35f7d4870555bc55dc35d83ca3ab84dc0639c9 Mon Sep 17 00:00:00 2001 From: bapt Date: Fri, 29 Jul 2016 23:39:33 +0000 Subject: Prevent collision with getline(3) --- news/newspost/files/patch-base_newspost.c | 11 +++++++++++ news/newspost/files/patch-base_utils.c | 11 +++++++++++ news/newspost/files/patch-base_utils.h | 11 +++++++++++ news/newspost/files/patch-ui_options.c | 20 ++++++++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 news/newspost/files/patch-base_newspost.c create mode 100644 news/newspost/files/patch-base_utils.c create mode 100644 news/newspost/files/patch-base_utils.h create mode 100644 news/newspost/files/patch-ui_options.c diff --git a/news/newspost/files/patch-base_newspost.c b/news/newspost/files/patch-base_newspost.c new file mode 100644 index 000000000000..0f1a9e9341c0 --- /dev/null +++ b/news/newspost/files/patch-base_newspost.c @@ -0,0 +1,11 @@ +--- base/newspost.c.orig 2003-04-23 15:33:23 UTC ++++ base/newspost.c +@@ -342,7 +342,7 @@ static Buff *read_text_file(Buff *text_b + file = fopen(filename, "r"); + if (file != NULL) { + while (!feof(file)) { +- line = getline(line, file); ++ line = get_line(line, file); + if(line == NULL){ + text_buffer = buff_add(text_buffer, "\r\n"); + continue; diff --git a/news/newspost/files/patch-base_utils.c b/news/newspost/files/patch-base_utils.c new file mode 100644 index 000000000000..9288095a7c66 --- /dev/null +++ b/news/newspost/files/patch-base_utils.c @@ -0,0 +1,11 @@ +--- base/utils.c.orig 2003-04-23 15:33:23 UTC ++++ base/utils.c +@@ -43,7 +43,7 @@ file_entry * file_entry_free(file_entry + return NULL; + } + +-Buff * getline(Buff *buff, FILE *file){ ++Buff * get_line(Buff *buff, FILE *file){ + char c = fgetc(file); + buff = buff_free(buff); + while(TRUE){ diff --git a/news/newspost/files/patch-base_utils.h b/news/newspost/files/patch-base_utils.h new file mode 100644 index 000000000000..c590c6441333 --- /dev/null +++ b/news/newspost/files/patch-base_utils.h @@ -0,0 +1,11 @@ +--- base/utils.h.orig 2003-02-08 15:09:41 UTC ++++ base/utils.h +@@ -26,7 +26,7 @@ file_entry; + file_entry * file_entry_alloc(); + file_entry * file_entry_free(file_entry *fe); + +-Buff * getline(Buff *buff, FILE *file); ++Buff * get_line(Buff *buff, FILE *file); + Buff *buff_add(Buff *buff, char *data, ... ); + Buff * buff_free(Buff *buff); + Buff *buff_create(Buff *buff, char *data, ... ); diff --git a/news/newspost/files/patch-ui_options.c b/news/newspost/files/patch-ui_options.c new file mode 100644 index 000000000000..ceded22d39ec --- /dev/null +++ b/news/newspost/files/patch-ui_options.c @@ -0,0 +1,20 @@ +--- ui/options.c.orig 2003-04-23 15:33:33 UTC ++++ ui/options.c +@@ -332,7 +332,7 @@ void parse_defaults(newspost_data *data) + file = fopen(filename->data, "r"); + if (file != NULL) { + while (!feof(file)) { +- line = getline(line, file); ++ line = get_line(line, file); + linenum++; + if(line == NULL) continue; + +@@ -429,7 +429,7 @@ void parse_defaults(newspost_data *data) + linenum = 0; + while (linenum < 8) { + linenum++; +- line = getline(line, file); ++ line = get_line(line, file); + if(line == NULL) continue; + + switch (linenum) { -- cgit