From cea53848d3469fcae387c9f6ae689220d2385a56 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 5 Oct 2009 16:47:52 +0000 Subject: Actully guarantee array allocation in dmnsn_new_array(). --- libdimension/dimension/array.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libdimension/dimension/array.h') diff --git a/libdimension/dimension/array.h b/libdimension/dimension/array.h index 2154a9e..d962d42 100644 --- a/libdimension/dimension/array.h +++ b/libdimension/dimension/array.h @@ -19,9 +19,9 @@ *************************************************************************/ /* - * Simple thread-safe generalized arrays, for returning variable-length arrays - * from functions, and other fun stuff. All functions are inline for - * performance reasons. + * Simple generalized arrays, for returning variable-length arrays from + * functions, and other fun stuff. All functions are inline for performance + * reasons. */ #ifndef DIMENSION_ARRAY_H @@ -52,6 +52,8 @@ dmnsn_new_array(size_t obj_size) if (!array->ptr) { dmnsn_error(DMNSN_SEVERITY_HIGH, "Array allocation failed."); } + } else { + dmnsn_error(DMNSN_SEVERITY_HIGH, "Array allocation failed."); } return array; -- cgit v1.2.3