re PR libfortran/42996 (Incorrect length returned from get_command_argument intrinsic)

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.

From-SVN: r156630
This commit is contained in:
Tobias Burnus 2010-02-09 18:04:57 +01:00 committed by Tobias Burnus
parent 57257f0dd5
commit e76e92315f
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,9 @@
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.
2010-02-06 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/42742

View File

@ -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)