/[marvin]/marvin/src/gui/file.cc
ViewVC logotype

Diff of /marvin/src/gui/file.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by castor_fou, Thu Sep 11 00:12:49 2003 UTC revision 1.2 by castor_fou, Thu Sep 11 14:08:43 2003 UTC
# Line 5  Line 5 
5  // Login   <castor@epita.fr>  // Login   <castor@epita.fr>
6  //  //
7  // Started on  Thu Aug 28 13:20:33 2003 C@stor  // Started on  Thu Aug 28 13:20:33 2003 C@stor
8  // Last update Wed Sep 10 01:29:52 2003 C@stor  // Last update Thu Sep 11 15:58:38 2003 C@stor
9  //  //
10    
11  #include <fcntl.h>  #include <fcntl.h>
# Line 116  int c_list_user::load_user() Line 116  int c_list_user::load_user()
116  int c_list_user::save_user()  int c_list_user::save_user()
117  {  {
118    FILE *file;    FILE *file;
119    unsigned int i;    list_t::const_iterator i;
120    char newline = '\n', sep = ':';    char newline = '\n', sep = ':';
121    
122    if ((file = fopen(FILE_USER, "w")) == NULL)    if ((file = fopen(FILE_USER, "w")) == NULL)
123      return 1;      return 1;
124    
125    for (i = 0; i < _list_user.size(); i++)    for (i = _list_user.begin(); i != _list_user.end(); i++)
126      {      {
127        fwrite(_list_user[i]->get_name_user().c_str(),        fwrite(((*i).second)->get_name_user().c_str(),
128               sizeof (char), _list_user[i]->get_name_user().size(), file);               sizeof (char), ((*i).second)->get_name_user().size(), file);
129        fwrite(&sep, sizeof (char), 1, file);        fwrite(&sep, sizeof (char), 1, file);
130        fwrite(_list_user[i]->get_password()->get_passphrase().c_str(),        fwrite(((*i).second)->get_password()->get_passphrase().c_str(),
131               sizeof (char), _list_user[i]->get_password()->get_passphrase().size(), file);               sizeof (char), ((*i).second)->get_password()->get_passphrase().size(), file);
132        fwrite(&sep, sizeof (char), 1, file);        fwrite(&sep, sizeof (char), 1, file);
133        fwrite(_list_user[i]->get_password()->get_neuronal().c_str(),        fwrite(((*i).second)->get_password()->get_neuronal().c_str(),
134               sizeof (char), _list_user[i]->get_password()->get_neuronal().size(), file);               sizeof (char), ((*i).second)->get_password()->get_neuronal().size(), file);
135        fwrite(&newline, sizeof (char), 1, file);        fwrite(&newline, sizeof (char), 1, file);
136      }      }
137    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26