summaryrefslogtreecommitdiff
path: root/gcc/collect2.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-02 19:04:39 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2009-06-02 19:04:39 +0000
commit329cbab59d9bb1bfbfc5f7ff268456618474d51f (patch)
tree8e1c4102d3c40d7527e0ec7628300736d8e0be8b /gcc/collect2.c
parent5b69e2e1d49009faa029ccc3f7c54af76105e30b (diff)
downloadgcc-329cbab59d9bb1bfbfc5f7ff268456618474d51f.tar.gz
gcc/
* collect2.c (ignore_library): Avoid premature post-increment and null deference. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148095 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/collect2.c')
-rw-r--r--gcc/collect2.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c
index d15a81af182..a500147e563 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -2448,9 +2448,11 @@ static int ignore_library (const char *);
static int
ignore_library (const char *name)
{
- const char *const *p = &aix_std_libs[0];
- while (*p++ != NULL)
- if (! strcmp (name, *p)) return 1;
+ const char *const *p;
+
+ for (p = &aix_std_libs[0]; *p != NULL; ++p)
+ if (strcmp (name, *p) == 0)
+ return 1;
return 0;
}
#endif /* COLLECT_EXPORT_LIST */