[Asterisk-code-review] translate.c: Fix truncation in 'core show translation' (asterisk[13])

Sean Bright asteriskteam at digium.com
Mon Jan 20 14:01:06 CST 2020


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/13665 )


Change subject: translate.c: Fix truncation in 'core show translation'
......................................................................

translate.c: Fix truncation in 'core show translation'

The last translation was always being cut off because of an off-by-one
error.

ASTERISK~19871
Reported by: Bala

Change-Id: Ie1a551a8a484e07b45c8699cc0c90f1061029510
---
M main/translate.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/65/13665/1

diff --git a/main/translate.c b/main/translate.c
index acfe5df..2460143 100644
--- a/main/translate.c
+++ b/main/translate.c
@@ -995,7 +995,7 @@
 	ast_cli(a->fd, "         Translation times between formats (in microseconds) for one second of data\n");
 	ast_cli(a->fd, "          Source Format (Rows) Destination Format (Columns)\n\n");
 
-	for (i = 0; i < num_codecs; i++) {
+	for (i = 0; i <= num_codecs; i++) {
 		struct ast_codec *row = i ? ast_codec_get_by_id(i) : NULL;
 
 		x = -1;
@@ -1010,7 +1010,7 @@
 		}
 
 		ast_str_set(&out, 0, " ");
-		for (k = 0; k < num_codecs; k++) {
+		for (k = 0; k <= num_codecs; k++) {
 			int adjust = 0;
 			struct ast_codec *col = k ? ast_codec_get_by_id(k) : NULL;
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/13665
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Change-Id: Ie1a551a8a484e07b45c8699cc0c90f1061029510
Gerrit-Change-Number: 13665
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20200120/9de0f6e4/attachment.html>


More information about the asterisk-code-review mailing list