summaryrefslogtreecommitdiffstats
path: root/src/ar.c
diff options
context:
space:
mode:
authorRoland McGrath <[email protected]>2011-11-05 20:58:14 -0700
committerRoland McGrath <[email protected]>2011-11-05 20:58:14 -0700
commit4fa988e13d09465b8ae4f605333fabf39d50fd30 (patch)
tree428f3e9df05fe74805c507c70a1debf80356e0f1 /src/ar.c
parentef431cd30b8a1a6b12a8783516fc95da88a9a636 (diff)
ar: Fix a return value check.
Diffstat (limited to 'src/ar.c')
-rw-r--r--src/ar.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ar.c b/src/ar.c
index bfb324c7..37d56b64 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -1302,7 +1302,8 @@ do_oper_insert (int oper, const char *arfname, char **argv, int argc,
found[cnt]->name = bname;
found[cnt]->mem = elf_rawfile (newelf, &found[cnt]->size);
- if (found[cnt] == NULL || elf_cntl (newelf, ELF_C_FDDONE) != 0)
+ if (found[cnt]->mem == NULL
+ || elf_cntl (newelf, ELF_C_FDDONE) != 0)
error (EXIT_FAILURE, 0, gettext ("cannot read %s: %s"),
argv[cnt], elf_errmsg (-1));