Ignore:
Timestamp:
Jul 24, 2008, 1:56:00 PM (17 years ago)
Author:
Frederik Heber <heber@…>
Children:
b3eb8e
Parents:
ed5f58
Message:

BUGFIX: elements.db is now using path instead of file

elements database was not correctly stored, as a filename was still given in Load/StorePeriodentafel instead of the path. This is corrected.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/periodentafel.cpp

    red5f58 r0f7a85  
    303303/** Stores element list to file.
    304304 */
    305 bool periodentafel::StorePeriodentafel(char *filename) const
     305bool periodentafel::StorePeriodentafel(char *path) const
    306306{
    307307  bool result = true;
    308308  ofstream f;
    309   char file[MAXSTRINGSIZE];
    310  
    311   if (filename == STANDARDELEMENTSDB)
    312     f.open(file);
    313   else
    314     f.open(filename);
     309  char filename[MAXSTRINGSIZE];
     310 
     311  strncpy(filename, path, MAXSTRINGSIZE);
     312  strncat(filename, "/", MAXSTRINGSIZE-strlen(filename));
     313  strncat(filename, STANDARDELEMENTSDB, MAXSTRINGSIZE-strlen(filename));
     314  f.open(filename);
    315315  if (f != NULL) {
    316316    f << header1 << endl;
Note: See TracChangeset for help on using the changeset viewer.