hrev54681 adds 1 changeset to branch 'master'
old head: 4f819c8959a42ab1ece0c30b1546e7c60f4b1242
new head: ef2e30aacaa10567ca8a0a1348b9760e5d63c857
overview:
https://git.haiku-os.org/haiku/log/?qt=range&q=ef2e30aacaa1+%5E4f819c8959a4
----------------------------------------------------------------------------
ef2e30aacaa1: boot/loader: Fix -Wformat-security
Change-Id: I760d2c7a99f0d20ae6d81c09f9ba786013c405d6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3354
Reviewed-by: Jérôme Duval <jerome.duval@xxxxxxxxx>
[ Murai Takashi <tmurai01@xxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev54681
Commit: ef2e30aacaa10567ca8a0a1348b9760e5d63c857
URL: https://git.haiku-os.org/haiku/commit/?id=ef2e30aacaa1
Author: Murai Takashi <tmurai01@xxxxxxxxx>
Date: Wed Oct 14 21:07:31 2020 UTC
Committer: Jérôme Duval <jerome.duval@xxxxxxxxx>
Commit-Date: Wed Oct 28 16:25:26 2020 UTC
----------------------------------------------------------------------------
1 file changed, 10 insertions(+), 10 deletions(-)
src/system/boot/loader/FileMapDisk.cpp | 20 ++++++++++----------
----------------------------------------------------------------------------
diff --git a/src/system/boot/loader/FileMapDisk.cpp
b/src/system/boot/loader/FileMapDisk.cpp
index 06b2cd67c9..5b079c75bb 100644
--- a/src/system/boot/loader/FileMapDisk.cpp
+++ b/src/system/boot/loader/FileMapDisk.cpp
@@ -69,7 +69,7 @@ status_t
FileMapDisk::Open(void **_cookie, int mode)
{
TRACE(("FileMapDisk::Open(, 0x%08x)\n", mode));
- if (!fNode)
+ if (fNode == NULL)
return B_NO_INIT;
return fNode->Open(_cookie, mode);
@@ -80,7 +80,7 @@ status_t
FileMapDisk::Close(void *cookie)
{
TRACE(("FileMapDisk::Close(%p)\n", cookie));
- if (!fNode)
+ if (fNode == NULL)
return B_NO_INIT;
return fNode->Close(cookie);
@@ -93,7 +93,7 @@ FileMapDisk::ReadAt(void *cookie, off_t pos, void *_buffer,
size_t bufferSize)
{
TRACE(("FileMapDisk::ReadAt(%p, %lld, , %ld)\n", cookie, pos,
bufferSize));
- if (!fNode)
+ if (fNode == NULL)
return B_NO_INIT;
return fNode->ReadAt(cookie, pos, _buffer, bufferSize);
@@ -114,10 +114,10 @@ status_t
FileMapDisk::GetName(char *nameBuffer, size_t bufferSize) const
{
const char *prefix = "FileMapDisk:";
- if (!nameBuffer)
+ if (nameBuffer == NULL)
return B_BAD_VALUE;
- snprintf(nameBuffer, bufferSize, prefix);
+ strlcpy(nameBuffer, prefix, bufferSize);
if (bufferSize > strlen(prefix) && fNode)
return fNode->GetName(nameBuffer + strlen(prefix),
bufferSize - strlen(prefix));
@@ -136,7 +136,7 @@ FileMapDisk::GetFileMap(struct file_map_run *runs, int32
*count)
off_t
FileMapDisk::Size() const
{
- if (!fNode)
+ if (fNode == NULL)
return B_NO_INIT;
return fNode->Size();
}
@@ -149,23 +149,23 @@ FileMapDisk::FindAnyFileMapDisk(Directory *volume)
Node *node;
status_t error;
- if (!volume)
+ if (volume == NULL)
return NULL;
//XXX: check lower/mixed case as well
Node *dirnode;
Directory *dir;
dirnode = volume->Lookup(FMAP_FOLDER_NAME, true);
- if (!dirnode || !S_ISDIR(dirnode->Type()))
+ if (dirnode == NULL || !S_ISDIR(dirnode->Type()))
return NULL;
dir = (Directory *)dirnode;
node = dir->Lookup(FMAP_IMAGE_NAME, true);
- if (!node)
+ if (node == NULL)
return NULL;
// create a FileMapDisk object
FileMapDisk *disk = new(nothrow) FileMapDisk;
- if (disk) {
+ if (disk != NULL) {
error = disk->Init(node);
if (error != B_OK) {
delete disk;