Fixed bug that looped forever if receiving an inlined NUL character.

git-svn-id: http://voip.null.ro/svn/yate@803 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2006-05-23 15:08:07 +00:00
parent 2579c6c617
commit eb1e800bc6
1 changed files with 10 additions and 0 deletions

View File

@ -73,8 +73,13 @@ String* getUnfoldedLine(const char** buf, int* len)
break;
case '\0':
// Should not happen - but let's accept what we got
Debug(DebugMild,"Unexpected NUL character while unfolding lines");
*res << s;
goOut = true;
// End parsing
b += l;
l = 0;
e = 0;
break;
default:
// Just count this character - we'll pick it later
@ -86,6 +91,11 @@ String* getUnfoldedLine(const char** buf, int* len)
}
*buf = b;
*len = l;
// Collect any leftover characters
if (e) {
String line(s,e);
*res << line;
}
res->trimBlanks();
return res;
}