CRITICAL: Do NOT call writefile() for a new user
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@229 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
parent
ccd503105e
commit
0676d450d0
|
@ -615,7 +615,7 @@ change_email ()
|
|||
}
|
||||
|
||||
int
|
||||
changepw ()
|
||||
changepw (int dowrite)
|
||||
{
|
||||
char buf[21];
|
||||
int error = 2;
|
||||
|
@ -670,7 +670,9 @@ changepw ()
|
|||
|
||||
free(me->password);
|
||||
me->password = strdup (crypt (buf, buf));
|
||||
writefile (0);
|
||||
|
||||
if (dowrite == 1)
|
||||
writefile (0);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -993,7 +995,7 @@ newuser ()
|
|||
|
||||
clear ();
|
||||
|
||||
if (!changepw ()) /* Calling changepw instead to prompt twice. */
|
||||
if (!changepw (0)) /* Calling changepw instead to prompt twice. */
|
||||
{
|
||||
free(me->username);
|
||||
free(me);
|
||||
|
@ -1506,7 +1508,7 @@ menuloop (void)
|
|||
{
|
||||
case 'c':
|
||||
if (loggedin)
|
||||
changepw ();
|
||||
changepw (1);
|
||||
break;
|
||||
case 'e':
|
||||
if (loggedin)
|
||||
|
|
|
@ -73,7 +73,7 @@ extern void drawbanner(unsigned int start_line, unsigned int howmany);
|
|||
extern struct dg_game **populate_games(int *l);
|
||||
extern void inprogressmenu(void);
|
||||
extern void change_email(void);
|
||||
extern int changepw(void);
|
||||
extern int changepw(int dowrite);
|
||||
extern void domailuser(char *username);
|
||||
extern void drawmenu(void);
|
||||
extern void freefile(void);
|
||||
|
|
Loading…
Reference in New Issue