Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(919)

Unified Diff: gcc/libgfortran/intrinsics/args.c

Issue 3050029: [gcc] GCC 4.5.0=>4.5.1 (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/nacl-toolchain.git
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gcc/libgfortran/generated/unpack_r8.c ('k') | gcc/libgfortran/intrinsics/c99_functions.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/libgfortran/intrinsics/args.c
diff --git a/gcc/libgfortran/intrinsics/args.c b/gcc/libgfortran/intrinsics/args.c
index 7187beccb74af89eda34c4c5d2a9f63f50976692..545cfe506b39afcc04918f664ab3d3317003446c 100644
--- a/gcc/libgfortran/intrinsics/args.c
+++ b/gcc/libgfortran/intrinsics/args.c
@@ -1,6 +1,7 @@
/* Implementation of the GETARG and IARGC g77, and
corresponding F2003, intrinsics.
- Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2007, 2009, 2010
+ Free Software Foundation, Inc.
Contributed by Bud Davis and Janne Blomqvist.
This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -147,11 +148,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)
« no previous file with comments | « gcc/libgfortran/generated/unpack_r8.c ('k') | gcc/libgfortran/intrinsics/c99_functions.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698