diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-02-09 17:04:57 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-02-09 17:04:57 +0000 |
commit | ad7f2bea513e6ab70415a7ad51bae6037c087dbf (patch) | |
tree | 71189d7060b7e8fe01a8d99f1451299c2074d200 /libgfortran/intrinsics | |
parent | fda153ea61623790645dbb963904a26b01b6865b (diff) | |
download | gcc-ad7f2bea513e6ab70415a7ad51bae6037c087dbf.tar.gz |
2010-02-09 Tobias Burnus <burnus@net-b.de>
PR fortran/42996
* intrinsics/args.c (get_command_argument_i4): Always return
commandline-argument length for length parameter.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@156630 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/intrinsics')
-rw-r--r-- | libgfortran/intrinsics/args.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libgfortran/intrinsics/args.c b/libgfortran/intrinsics/args.c index 7187beccb74..83a0502fe15 100644 --- a/libgfortran/intrinsics/args.c +++ b/libgfortran/intrinsics/args.c @@ -147,11 +147,9 @@ get_command_argument_i4 (GFC_INTEGER_4 *number, char *value, if (value != NULL && stat_flag != GFC_GC_FAILURE) { if (arglen > value_len) - { - arglen = value_len; stat_flag = GFC_GC_VALUE_TOO_SHORT; - } - memcpy (value, argv[*number], arglen); + + memcpy (value, argv[*number], arglen <= value_len ? arglen : value_len); } if (length != NULL) |