[Asterisk-code-review] app voicemail: Remove need to subscribe to stasis (asterisk[13])

Sean Bright asteriskteam at digium.com
Tue Sep 18 07:14:41 CDT 2018


Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/10132 )

Change subject: app_voicemail: Remove need to subscribe to stasis
......................................................................


Patch Set 6:

(1 comment)

It's low impact and improves the quality of the code, so let's go ahead and change it. The "Allow for separator and terminator" should be removed during that process.

https://gerrit.asterisk.org/#/c/10132/6/apps/app_voicemail.c
File apps/app_voicemail.c:

https://gerrit.asterisk.org/#/c/10132/6/apps/app_voicemail.c@12195
PS6, Line 12195: 	char *mailbox;
               : 
               : 	if (!ast_strlen_zero(vmu->mailbox)) {
               : 		len += strlen(vmu->mailbox);
               : 	}
               : 
               : 	if (!ast_strlen_zero(vmu->context)) {
               : 		len += strlen(vmu->context) + 1; /* Allow for seperator and terminator */
               : 	}
               : 
               : 	mailbox = ast_alloca(len);
               : 	if (!ast_strlen_zero(vmu->mailbox)) {
               : 		strcpy(mailbox, vmu->mailbox); /* Safe */
               : 	}
               : 
               : 	if (!ast_strlen_zero(vmu->context)) {
               : 		strcat(mailbox, "@");  /* Safe */
               : 		strcat(mailbox, vmu->context);  /* Safe */
               : 	}
               : 
               : 	if (ast_strlen_zero(mailbox)) {
               : 		ast_log(LOG_ERROR, "Mailbox can't be empty\n");
               : 		return -1;
               : 	}
> Oh.  Yes.  They theoretically could be NULL in the old place if the
 > allocation failed. :)
 > 
 > However, vmu->context could be an empty string which would need to
 > result in no '@' in the generated mailbox string.  It is difficult
 > to determine if context would ever really be an empty string now
 > and not be set to "default" if the user didn't configure a context.
 > 
 > Probably best not to make this change.



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

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: comment
Gerrit-Change-Id: I5cceb737246949f9782955c64425b8bd25a9e9ee
Gerrit-Change-Number: 10132
Gerrit-PatchSet: 6
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Sean Bright <sean.bright at gmail.com>
Gerrit-Comment-Date: Tue, 18 Sep 2018 12:14:41 +0000
Gerrit-HasComments: Yes
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180918/34c0e28a/attachment-0001.html>


More information about the asterisk-code-review mailing list