aboutsummaryrefslogtreecommitdiff
path: root/sim/common/sim-watch.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-01-12 21:58:08 +0000
committerMike Frysinger <vapier@gentoo.org>2011-01-12 21:58:08 +0000
commit39a3ae0a219ead81eeb3364aeafdd99a4cdefc6e (patch)
treeedd94578e806522016a16111355f077e90441a57 /sim/common/sim-watch.c
parent1b05df007beb1cbcc8cd9fd28d82d614a75e9432 (diff)
downloadfsf-binutils-gdb-39a3ae0a219ead81eeb3364aeafdd99a4cdefc6e.zip
fsf-binutils-gdb-39a3ae0a219ead81eeb3364aeafdd99a4cdefc6e.tar.gz
fsf-binutils-gdb-39a3ae0a219ead81eeb3364aeafdd99a4cdefc6e.tar.bz2
sim: check asprintf return values
These are the last sources of build warnings (asprintf usage) that I see. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'sim/common/sim-watch.c')
-rw-r--r--sim/common/sim-watch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sim/common/sim-watch.c b/sim/common/sim-watch.c
index ccef4fe..022ca13 100644
--- a/sim/common/sim-watch.c
+++ b/sim/common/sim-watch.c
@@ -412,9 +412,10 @@ sim_watchpoint_install (SIM_DESC sd)
char *name;
int nr = interrupt_nr * nr_watchpoint_types + type;
OPTION *option = &int_options[nr];
- asprintf (&name, "watch-%s-%s",
- watchpoint_type_to_str (sd, type),
- interrupt_nr_to_str (sd, interrupt_nr));
+ if (asprintf (&name, "watch-%s-%s",
+ watchpoint_type_to_str (sd, type),
+ interrupt_nr_to_str (sd, interrupt_nr)) < 0)
+ return SIM_RC_FAIL;
option->opt.name = name;
option->opt.has_arg = required_argument;
option->opt.val = type_to_option (sd, type, interrupt_nr);