Ignore:
Timestamp:
2001-01-26T10:29:32+13:00 (23 years ago)
Author:
sjboddie
Message:

Fixed a couple of minor things to get it compiling on windows again

File:
1 edited

Legend:

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

    r1837 r1864  
    346346// For current needs it's fine though.
    347347// -- Pass a linelength of 0 to use the default linelength (256 chars).
     348// -- The maximum value of linelength is MAXLINELENGTH
    348349text_t file_tail (const text_t &filename, int numlines, int linelength) {
    349350
     351#define MAXLINELENGTH 2048
     352
    350353  if (numlines < 1) numlines = 1;
    351   if (linelength == 0) linelength = 256;
    352  
     354  if (linelength < 1) linelength = 256;
     355  if (linelength > MAXLINELENGTH) linelength = MAXLINELENGTH;
     356
    353357  streampos numchars = linelength*numlines;
    354358
     
    357361
    358362  char *filenamec = filename.getcstr();
    359   char linec[linelength];
     363  char linec[MAXLINELENGTH];
    360364  ifstream file_in (filenamec);
    361365  delete filenamec;
Note: See TracChangeset for help on using the changeset viewer.