* 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:
parent
384ed4569c
commit
0ee4261ea8
@ -154,19 +154,21 @@ Keymap::Load(entry_ref &ref)
|
|||||||
|
|
||||||
fChars = new char[fCharsSize];
|
fChars = new char[fCharsSize];
|
||||||
|
|
||||||
err = file.Read(fChars, fCharsSize);
|
ssize_t bytesRead = file.Read(fChars, fCharsSize);
|
||||||
if (err < B_OK) {
|
if (bytesRead < 0) {
|
||||||
fprintf(stderr, "error reading keymap chars: %s\n", strerror(err));
|
fprintf(stderr, "error reading keymap chars: %s\n", strerror(err));
|
||||||
|
return (status_t)bytesRead;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fetch name from attribute and fall back to filename
|
// 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)
|
if (bytesRead > 0)
|
||||||
fName[bytesRead] = '\0';
|
fName[bytesRead] = '\0';
|
||||||
else
|
else
|
||||||
strlcpy(fName, ref.name, sizeof(fName));
|
strlcpy(fName, ref.name, sizeof(fName));
|
||||||
return err;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user