Clean 'shadowed declaration' warnings

index is a function in string.h, so replace index with idx all over the
source code.
2 files changed