Go to the source code of this file.
Defines | |
| #define | SAFE_GETLINE(_IS, _LINE, _SIZE, _DELIM, _FILE) |
| #define SAFE_GETLINE | ( | _IS, | |||
| _LINE, | |||||
| _SIZE, | |||||
| _DELIM, | |||||
| _FILE | ) |
Value:
{ \
_IS.getline(_LINE, _SIZE, _DELIM); \
if(_IS.fail() && !_IS.bad() && !_IS.eof()) _IS.clear(); \
if (_IS.gcount() == _SIZE-1) { \
cerr << "Line too long! Buffer overflow. Delete lines >=" \
<< _SIZE << " chars or raise LINE_MAX_LENGTH in " << _FILE \
<< endl; \
exit(1); \
} \
}
Definition at line 24 of file SafeGetline.h.
1.5.9