Changeset 1864 for trunk/gsdl/lib/fileutil.cpp
- Timestamp:
- 2001-01-26T10:29:32+13:00 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/lib/fileutil.cpp
r1837 r1864 346 346 // For current needs it's fine though. 347 347 // -- Pass a linelength of 0 to use the default linelength (256 chars). 348 // -- The maximum value of linelength is MAXLINELENGTH 348 349 text_t file_tail (const text_t &filename, int numlines, int linelength) { 349 350 351 #define MAXLINELENGTH 2048 352 350 353 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 353 357 streampos numchars = linelength*numlines; 354 358 … … 357 361 358 362 char *filenamec = filename.getcstr(); 359 char linec[ linelength];363 char linec[MAXLINELENGTH]; 360 364 ifstream file_in (filenamec); 361 365 delete filenamec;
Note:
See TracChangeset
for help on using the changeset viewer.