From: Mark Spencer Date: Wed, 25 Feb 2004 04:24:51 +0000 (+0000) Subject: Don't be biased against G.726 in translation table X-Git-Tag: 1.0.0-rc1~1046 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8bfe5e86b48699fb0698e2c91def87e875a09c11;p=thirdparty%2Fasterisk.git Don't be biased against G.726 in translation table git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2240 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/translate.c b/translate.c index 0514bb9848..c297886329 100755 --- a/translate.c +++ b/translate.c @@ -264,17 +264,16 @@ static int show_translation(int fd, int argc, char *argv[]) for (x=-1;x= 0 && y >= 0 && tr_matrix[x][y].step) - snprintf(line + strlen(line), sizeof(line) - strlen(line), " %6d", tr_matrix[x][y].cost); + if (x >= 0 && y >= 0 && tr_matrix[x][y].step) + snprintf(line + strlen(line), sizeof(line) - strlen(line), " %5d", tr_matrix[x][y].cost); else - if ((y != 4) && ((x == -1 && y >= 0) || (y == -1 && x >= 0))) { + if (((x == -1 && y >= 0) || (y == -1 && x >= 0))) { snprintf(line + strlen(line), sizeof(line) - strlen(line), - " %6s", ast_getformatname(1<<(x+y+1)) ); + " %5s", ast_getformatname(1<<(x+y+1)) ); } else if (x != -1 && y != -1 && y != 4) { - snprintf(line + strlen(line), sizeof(line) - strlen(line), " -"); + snprintf(line + strlen(line), sizeof(line) - strlen(line), " -"); } else if (y != 4) { - snprintf(line + strlen(line), sizeof(line) - strlen(line), " "); + snprintf(line + strlen(line), sizeof(line) - strlen(line), " "); } } snprintf(line + strlen(line), sizeof(line) - strlen(line), "\n");