Changeset 2302


Ignore:
Timestamp:
2001-04-10T15:19:31+12:00 (23 years ago)
Author:
sjboddie
Message:

Fixed a bug that's been annoying me for a while but that I was far too
stupid to spot. Thanks to Manuel in Romania for pointing it out.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/lib/fileutil.cpp

    r1864 r2302  
    156156  WIN32_FIND_DATA FileData; 
    157157  HANDLE hSearch;
    158   char *dirpath = dirname.getcstr();
    159   strcat (dirpath, "\\*");
     158
     159  text_t dir = dirname + "\\*";
     160  char *dirpath = dir.getcstr();
    160161 
    161162  hSearch = FindFirstFile(dirpath, &FileData);
     
    166167
    167168  FindClose (hSearch);
    168   // freeing this memory can cause a runtime error on some (particularly
    169   // debug) versions of VC++
    170169  delete dirpath;
    171170  return true;
     
    176175  WIN32_FIND_DATA FileData; 
    177176  HANDLE hSearch;
    178   char *dirpath = dirname.getcstr();
    179   strcat (dirpath, "\\*");
     177 
     178  text_t dir = dirname + "\\*";
     179  char *dirpath = dir.getcstr();
    180180 
    181181  hSearch = FindFirstFile(dirpath, &FileData);
     
    197197 
    198198  FindClose(hSearch);
    199   // freeing this memory can cause a runtime error on some (particularly
    200   // debug) versions of VC++
    201199  delete dirpath;
    202200 
     
    208206  WIN32_FIND_DATA FileData; 
    209207  HANDLE hSearch;
    210   char *dirpath = dirname.getcstr();
    211   strcat (dirpath, "\\*");
     208 
     209  text_t dir = dirname + "\\*";
     210  char *dirpath = dir.getcstr();
    212211 
    213212  hSearch = FindFirstFile(dirpath, &FileData);
     
    229228 
    230229  FindClose(hSearch);
    231   // freeing this memory can cause a runtime error on some (particularly
    232   // debug) versions of VC++
    233230  delete dirpath;
    234231
Note: See TracChangeset for help on using the changeset viewer.