Merge sorted arrays

void Merge(int a[], int b[], int lenA, int lenB)
{
    for (int bIndex = lenB - 1; bIndex >= 0; bIndex--)
    {
        int previous = a[lenA - 1];
        int aIndex;

        for (aIndex = lenA - 2; aIndex >= 0 && a[aIndex] > b[bIndex]; aIndex--)
        {
            a[aIndex + 1] = a[aIndex];
        }

        if (aIndex != lenA - 2 || previous > b[bIndex])
        {
            a[aIndex + 1] = b[bIndex];
            b[bIndex] = previous;
        }
    }
}