Fix app_chanisavail.c when passed string is big (bug #1139)