freetdm: do not decrement an unsigned when is already zero!

This commit is contained in:
Moises Silva 2010-06-05 16:38:12 -04:00
parent 0152706fa9
commit 3ace62c825
1 changed files with 7 additions and 10 deletions

View File

@ -1372,15 +1372,6 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_open_by_group(uint32_t group_id, ftdm_dir
ftdm_mutex_lock(group->mutex);
for (;;) {
if (direction == FTDM_TOP_DOWN) {
if (i >= group->chan_count) {
break;
}
} else {
if (i < 0) {
break;
}
}
if (!(check = group->channels[i])) {
status = FTDM_FAIL;
@ -1410,10 +1401,16 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_open_by_group(uint32_t group_id, ftdm_dir
}
if (direction == FTDM_TOP_DOWN) {
if (i >= group->chan_count) {
break;
}
i++;
} else {
if (i == 0) {
break;
}
i--;
}
}
}
ftdm_mutex_unlock(group->mutex);
return status;