summaryrefslogtreecommitdiffstats
path: root/src/errors.c
diff options
context:
space:
mode:
authorGravatar Dan Dennedy 2008-07-06 12:06:40 -0700
committerGravatar Dan Dennedy 2008-07-06 12:06:40 -0700
commit8f942654d9c2b9cd957e8e1f7eb1f29a05bbf64a (patch)
tree3cdb6f52867ee18af06f7e478fcaa9e15e7a8510 /src/errors.c
parentFix raw1394_read_cycle_timer after juju integration (diff)
Change handle validation to prevent segfault and be more informative.
Diffstat (limited to 'src/errors.c')
-rw-r--r--src/errors.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/errors.c b/src/errors.c
index e69c131..10f1a32 100644
--- a/src/errors.c
+++ b/src/errors.c
@@ -19,7 +19,10 @@
raw1394_errcode_t raw1394_get_errcode(struct raw1394_handle *handle)
{
- if (handle && handle->is_fw)
+ if (!handle) {
+ return RAW1394_ERROR_INVALID_ARG;
+ }
+ if (handle->is_fw)
return handle->mode.fw->err;
else
return handle->mode.ieee1394->err;