summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2018-12-01 14:03:24 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2018-12-01 14:03:34 +0100
commit5f0829d7c0db5a4f9d008434e8e1bcd12ca59b9f (patch)
treed86f8a5daf1bd327cbe9800b61fd7a4f7a36552b
parent32621a1b9082425004ec66d268781570f60d8e4a (diff)
downloaddrakx-5f0829d7c0db5a4f9d008434e8e1bcd12ca59b9f.tar
drakx-5f0829d7c0db5a4f9d008434e8e1bcd12ca59b9f.tar.gz
drakx-5f0829d7c0db5a4f9d008434e8e1bcd12ca59b9f.tar.bz2
drakx-5f0829d7c0db5a4f9d008434e8e1bcd12ca59b9f.tar.xz
drakx-5f0829d7c0db5a4f9d008434e8e1bcd12ca59b9f.zip
better gcc8 workarounds
-rw-r--r--mdk-stage1/NEWS2
-rw-r--r--mdk-stage1/network.c4
-rw-r--r--mdk-stage1/thirdparty.c6
3 files changed, 7 insertions, 5 deletions
diff --git a/mdk-stage1/NEWS b/mdk-stage1/NEWS
index aa767c714..cf1cee68e 100644
--- a/mdk-stage1/NEWS
+++ b/mdk-stage1/NEWS
@@ -1,3 +1,5 @@
+- better gcc8 workarounds
+
2.35
- fix compiling with gcc8
diff --git a/mdk-stage1/network.c b/mdk-stage1/network.c
index f3e221047..ab512399a 100644
--- a/mdk-stage1/network.c
+++ b/mdk-stage1/network.c
@@ -1002,7 +1002,7 @@ enum return_type ftp_prepare(void)
int ftp_serv_response = -1;
int fd, size;
int need_arch = 0;
- char ftp_hostname[494];
+ char ftp_hostname[500];
if (!IS_AUTOMATIC) {
if (answers == NULL)
@@ -1108,7 +1108,7 @@ enum return_type ftp_prepare(void)
if (use_http_proxy) {
add_to_env("METHOD", "http");
- sprintf(location_full, "ftp://%s%s", ftp_hostname, answers[1]);
+ snprintf(location_full, sizeof(location_full), "ftp://%s%s", ftp_hostname, answers[1]);
if (need_arch)
strcat(location_full, "/" ARCH);
add_to_env("URLPREFIX", location_full);
diff --git a/mdk-stage1/thirdparty.c b/mdk-stage1/thirdparty.c
index 9a9e58e39..78bbf485a 100644
--- a/mdk-stage1/thirdparty.c
+++ b/mdk-stage1/thirdparty.c
@@ -241,10 +241,10 @@ static int pcitable_orderer(const void *a, const void *b)
static void thirdparty_load_pcitable(const char *modules_location)
{
- char pcitable_filename[110];
+ char pcitable_filename[100];
FILE * f = NULL;
- sprintf(pcitable_filename, "%s/pcitable", modules_location);
+ snprintf(pcitable_filename, sizeof(pcitable_filename), "%s/pcitable", modules_location);
if (!(f = fopen(pcitable_filename, "rb"))) {
log_message("third_party: no external pcitable found");
return;
@@ -346,7 +346,7 @@ static enum return_type thirdparty_autoload_modules(const char *modules_location
static enum return_type thirdparty_try_directory(char * root_directory, int interactive) {
char modules_location[100];
- char modules_location_release[200];
+ char modules_location_release[100];
char *list_filename;
FILE *f_load, *f_detect;
char **modules_list, **modules_list_release;