From: scottmk Date: Sun, 11 Jan 2009 22:11:34 +0000 (+0000) Subject: In the macro OSRF_LIST_GET_INDEX: placed all occurrences of the macro arguments X-Git-Tag: osrf_rel_2_0_1~428 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=3d17cdceffee90e3af0bede90c82e90f2d761969;p=OpenSRF.git In the macro OSRF_LIST_GET_INDEX: placed all occurrences of the macro arguments in parentheses, to prevent unexpected effects when one or more of the arguments is an expression. git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1616 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/include/opensrf/osrf_list.h b/include/opensrf/osrf_list.h index 35ec116..aeaf357 100644 --- a/include/opensrf/osrf_list.h +++ b/include/opensrf/osrf_list.h @@ -7,7 +7,7 @@ extern "C" { #endif -#define OSRF_LIST_GET_INDEX(l, i) (!l || i >= l->size) ? NULL: l->arrlist[i] +#define OSRF_LIST_GET_INDEX(l, i) (!(l) || (i) >= (l)->size) ? NULL: (l)->arrlist[(i)] /** Items are stored as void*'s so it's up to the user to