mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 08:40:16 +00:00
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
This commit is contained in:
@@ -660,12 +660,11 @@ static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (!feof(configin)) {
|
while (!feof(configin)) {
|
||||||
|
char *user = NULL, *pass = NULL, *rest = NULL, *comment = NULL, *tmpctx = NULL, *tmpctxend = NULL;
|
||||||
|
|
||||||
/* Read in the line */
|
/* Read in the line */
|
||||||
fgets(inbuf, sizeof(inbuf), configin);
|
fgets(inbuf, sizeof(inbuf), configin);
|
||||||
linenum++;
|
linenum++;
|
||||||
if (!feof(configin)) {
|
|
||||||
char *user = NULL, *pass = NULL, *rest = NULL,
|
|
||||||
*comment = NULL, *tmpctx = NULL, *tmpctxend = NULL;
|
|
||||||
|
|
||||||
if (ast_strlen_zero(inbuf)) {
|
if (ast_strlen_zero(inbuf)) {
|
||||||
fprintf(configout, "\n");
|
fprintf(configout, "\n");
|
||||||
@@ -746,7 +745,6 @@ static void vm_change_password(struct ast_vm_user *vmu, const char *newpassword)
|
|||||||
fprintf(configout, "%s", orig);
|
fprintf(configout, "%s", orig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
fclose(configin);
|
fclose(configin);
|
||||||
fclose(configout);
|
fclose(configout);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user