aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-01-15 21:20:58 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2016-01-15 21:20:58 +0100
commitf47429917545ac2811630ff8648f05aa01aa3edf (patch)
tree749945fe686788f32050728b9e7666f38d73964b
parent4c0f272cfce3744f4420f86c07f44ed3cc5ecda1 (diff)
downloadgcc-f47429917545ac2811630ff8648f05aa01aa3edf.zip
gcc-f47429917545ac2811630ff8648f05aa01aa3edf.tar.gz
gcc-f47429917545ac2811630ff8648f05aa01aa3edf.tar.bz2
execute_command_line.c (set_cmdstat): Use "%s", msg instead of msg to avoid -Wformat-security warning.
* intrinsics/execute_command_line.c (set_cmdstat): Use "%s", msg instead of msg to avoid -Wformat-security warning. From-SVN: r232449
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/intrinsics/execute_command_line.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 362c835..c993191 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2016-01-15 Jakub Jelinek <jakub@redhat.com>
+
+ * intrinsics/execute_command_line.c (set_cmdstat): Use "%s", msg
+ instead of msg to avoid -Wformat-security warning.
+
2016-01-04 Jakub Jelinek <jakub@redhat.com>
Update copyright years.
diff --git a/libgfortran/intrinsics/execute_command_line.c b/libgfortran/intrinsics/execute_command_line.c
index 256c12d..c9f9176 100644
--- a/libgfortran/intrinsics/execute_command_line.c
+++ b/libgfortran/intrinsics/execute_command_line.c
@@ -1,6 +1,6 @@
/* Implementation of the EXECUTE_COMMAND_LINE intrinsic.
Copyright (C) 2009-2016 Free Software Foundation, Inc.
- Contributed by François-Xavier Coudert.
+ Contributed by François-Xavier Coudert.
This file is part of the GNU Fortran runtime library (libgfortran).
@@ -55,7 +55,7 @@ set_cmdstat (int *cmdstat, int value)
#define MSGLEN 200
char msg[MSGLEN] = "EXECUTE_COMMAND_LINE: ";
strncat (msg, cmdmsg_values[value], MSGLEN - strlen(msg) - 1);
- runtime_error (msg);
+ runtime_error ("%s", msg);
}
}