* Don't return positive status_t in Load() instead of B_OK.

* Small coding style corrections.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35219 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-01-21 14:39:08 +00:00
parent 384ed4569c
commit 0ee4261ea8

View File

@ -154,19 +154,21 @@ Keymap::Load(entry_ref &ref)
fChars = new char[fCharsSize];
err = file.Read(fChars, fCharsSize);
if (err < B_OK) {
ssize_t bytesRead = file.Read(fChars, fCharsSize);
if (bytesRead < 0) {
fprintf(stderr, "error reading keymap chars: %s\n", strerror(err));
return (status_t)bytesRead;
}
// fetch name from attribute and fall back to filename
ssize_t bytesRead
= file.ReadAttr("keymap:name", B_STRING_TYPE, 0, fName, sizeof(fName));
bytesRead = file.ReadAttr("keymap:name", B_STRING_TYPE, 0, fName,
sizeof(fName));
if (bytesRead > 0)
fName[bytesRead] = '\0';
else
strlcpy(fName, ref.name, sizeof(fName));
return err;
return B_OK;
}