Commit 51136ae8 by Richard Sandiford Committed by Richard Sandiford

collect2.c (ignore_library): Avoid premature post-increment and null deference.

gcc/
	* collect2.c (ignore_library): Avoid premature post-increment
	and null deference.

From-SVN: r148095
parent 7f142d33
2009-06-02 Richard Sandiford <r.sandiford@uk.ibm.com> 2009-06-02 Richard Sandiford <r.sandiford@uk.ibm.com>
* collect2.c (ignore_library): Avoid premature post-increment
and null deference.
2009-06-02 Richard Sandiford <r.sandiford@uk.ibm.com>
* Makefile.in (libgcc.mvars): Add TARGET_SYSTEM_ROOT. * Makefile.in (libgcc.mvars): Add TARGET_SYSTEM_ROOT.
* config/rs6000/aix.h (LINK_SYSCALLS_SPEC): Add %R to the * config/rs6000/aix.h (LINK_SYSCALLS_SPEC): Add %R to the
!CROSS_DIRECTORY_STRUCTURE alternative and use it for !CROSS_DIRECTORY_STRUCTURE alternative and use it for
......
...@@ -2448,9 +2448,11 @@ static int ignore_library (const char *); ...@@ -2448,9 +2448,11 @@ static int ignore_library (const char *);
static int static int
ignore_library (const char *name) ignore_library (const char *name)
{ {
const char *const *p = &aix_std_libs[0]; const char *const *p;
while (*p++ != NULL)
if (! strcmp (name, *p)) return 1; for (p = &aix_std_libs[0]; *p != NULL; ++p)
if (strcmp (name, *p) == 0)
return 1;
return 0; return 0;
} }
#endif /* COLLECT_EXPORT_LIST */ #endif /* COLLECT_EXPORT_LIST */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment