From: Alexandra Ellwood Date: Tue, 18 Sep 2007 19:48:19 +0000 (+0000) Subject: cci_array_move should work when the source and dest positions are equal X-Git-Tag: krb5-1.7-alpha1~877 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=426ef0b9515cc14e34ec0f6ef2ce13f7d9e9ec4b;p=krb5.git cci_array_move should work when the source and dest positions are equal Fixed so it does nothing when moving an element to its own index. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19950 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/ccapi/common/cci_array_internal.c b/src/ccapi/common/cci_array_internal.c index 3d1e35ef3..37ff695e3 100644 --- a/src/ccapi/common/cci_array_internal.c +++ b/src/ccapi/common/cci_array_internal.c @@ -270,7 +270,8 @@ cc_int32 cci_array_move (cci_array_t io_array, move_to = in_position; move_count = in_new_position - in_position - 1; real_new_position = in_new_position - 1; - } else { + + } else if (in_position > in_new_position) { /* shift left */ move_from = in_new_position; move_to = in_new_position + 1;