Changeset 310 for branches


Ignore:
Timestamp:
Mar 24, 2010, 7:51:16 PM (12 years ago)
Author:
dmik
Message:

branches/kmk: Reading .lng files: fixed memory leak and wrong ifstream usage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/kmk/Lucide/gui/intern.cpp

    r309 r310  
    102102    else
    103103    {
    104         char *line = new char[ LINEBUF_LEN ];
     104        char line[ LINEBUF_LEN ];
    105105
    106106        while ( !lngFile.eof() )
    107107        {
    108             char ch;
    109             lngFile.get( line, LINEBUF_LEN );
    110             lngFile.get( ch );
     108            // @todo this code will treat the rest of the line which is longer
     109            // than LINEBUF_LEN-1 chars as a new line which is wrong
     110            lngFile.getline( line, LINEBUF_LEN );
    111111            if ( ( line[ 0 ] != '#' ) && ( line[ 0 ] != ' ' ) )
    112112            {
Note: See TracChangeset for help on using the changeset viewer.