Fix indev out of bounds

Signed-off-by: Krzysztof Opasiak <ups100@tlen.pl>