properly handle password changes when mailbox is last line of config file and not followed by a newline (issue #5870)

reformat password changing code to conform to coding guidelines (issue #5870)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2-netsec
Kevin P. Fleming 20 years ago
parent 41023ecb9c
commit 0042c03c7e

@ -660,12 +660,11 @@ static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
}
while (!feof(configin)) {
char *user = NULL, *pass = NULL, *rest = NULL, *comment = NULL, *tmpctx = NULL, *tmpctxend = NULL;
/* Read in the line */
fgets(inbuf, sizeof(inbuf), configin);
linenum++;
if (!feof(configin)) {
char *user = NULL, *pass = NULL, *rest = NULL,
*comment = NULL, *tmpctx = NULL, *tmpctxend = NULL;
if (ast_strlen_zero(inbuf)) {
fprintf(configout, "\n");
@ -746,7 +745,6 @@ static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
fprintf(configout, "%s", orig);
}
}
}
fclose(configin);
fclose(configout);

Loading…
Cancel
Save