- unsigned lf = str.find('\n');
- vector<string> parts = split(str.substr(0, lf), ' ', 2);
+ string::size_type lf = str.find('\n');
+ if(lf==0)
+ throw invalid_argument("Response::parse");
+ vector<string> parts = split(str.substr(0, lf-(str[lf-1]=='\r')), ' ', 2);