Play safe with BString::LockBuffer...

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27806 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2008-10-01 01:22:51 +00:00
parent 59967bf000
commit 2e631be55d

View File

@ -111,7 +111,7 @@ status_t BeThemeImporter::ImportNextTheme(BMessage **theme)
char *buff;
buff = str.LockBuffer(1024);
memset(buff, 0, 1024);
file.Read(buff, 1024);
file.Read(buff, 1024-1);
if (err < B_OK)
return err;
str.UnlockBuffer();
@ -125,7 +125,7 @@ status_t BeThemeImporter::ImportNextTheme(BMessage **theme)
str = "";
buff = str.LockBuffer(1024);
memset(buff, 0, 1024);
file.Read(buff, 1024);
file.Read(buff, 1024-1);
if (err < B_OK)
return err;
str.UnlockBuffer();
@ -189,7 +189,7 @@ status_t BeThemeImporter::ImportNextTheme(BMessage **theme)
return B_ERROR;
buff = str.LockBuffer(1024);
memset(buff, 0, 1024);
file.Read(buff, 1024);
file.Read(buff, 1024-1);
if (err < B_OK)
return err;
str.UnlockBuffer();