From 5c78d8ec9e251e9e20b709a9ec6d9cccd32719c9 Mon Sep 17 00:00:00 2001 From: shatty Date: Wed, 13 Aug 2003 05:44:31 +0000 Subject: [PATCH] changed to not exercise r5 lib-style convert_to_utf8 behavior on 0 bytes because the r5 lib-style behavior contradicts the bebook specification git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4277 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/stylededit/StyledEditView.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/stylededit/StyledEditView.cpp b/src/apps/stylededit/StyledEditView.cpp index 9c8776a082..85be8e6067 100644 --- a/src/apps/stylededit/StyledEditView.cpp +++ b/src/apps/stylededit/StyledEditView.cpp @@ -127,7 +127,7 @@ StyledEditView::GetStyledText(BPositionIO * stream) char textBuffer[256]; int32 textLength = 256; int32 bytes = bytesRead; - while (textLength > 0) { + while ((textLength > 0) && (bytes > 0)) { result = convert_to_utf8(id,inPtr,&bytes,textBuffer,&textLength,&state); if (result != B_OK) { return result;