|
|
5975ab |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
5975ab |
From: Daniel Kiper <daniel.kiper@oracle.com>
|
|
|
5975ab |
Date: Mon, 29 Oct 2018 13:25:25 +0100
|
|
|
5975ab |
Subject: [PATCH] bufio: Use grub_size_t instead of plain int for size
|
|
|
5975ab |
|
|
|
5975ab |
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
5975ab |
Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com>
|
|
|
5975ab |
Reviewed-by: Ross Philipson <ross.philipson@oracle.com>
|
|
|
5975ab |
(cherry picked from commit f3f8347569383e7f483f37ca70d41eb1af9f990f)
|
|
|
5975ab |
Signed-off-by: Daniel Axtens <dja@axtens.net>
|
|
|
5975ab |
---
|
|
|
5975ab |
grub-core/io/bufio.c | 6 +++---
|
|
|
5975ab |
include/grub/bufio.h | 4 ++--
|
|
|
5975ab |
2 files changed, 5 insertions(+), 5 deletions(-)
|
|
|
5975ab |
|
|
|
5975ab |
diff --git a/grub-core/io/bufio.c b/grub-core/io/bufio.c
|
|
|
5975ab |
index 6118bade50d..2781afe0515 100644
|
|
|
5975ab |
--- a/grub-core/io/bufio.c
|
|
|
5975ab |
+++ b/grub-core/io/bufio.c
|
|
|
5975ab |
@@ -43,7 +43,7 @@ typedef struct grub_bufio *grub_bufio_t;
|
|
|
5975ab |
static struct grub_fs grub_bufio_fs;
|
|
|
5975ab |
|
|
|
5975ab |
grub_file_t
|
|
|
5975ab |
-grub_bufio_open (grub_file_t io, int size)
|
|
|
5975ab |
+grub_bufio_open (grub_file_t io, grub_size_t size)
|
|
|
5975ab |
{
|
|
|
5975ab |
grub_file_t file;
|
|
|
5975ab |
grub_bufio_t bufio = 0;
|
|
|
5975ab |
@@ -57,7 +57,7 @@ grub_bufio_open (grub_file_t io, int size)
|
|
|
5975ab |
else if (size > GRUB_BUFIO_MAX_SIZE)
|
|
|
5975ab |
size = GRUB_BUFIO_MAX_SIZE;
|
|
|
5975ab |
|
|
|
5975ab |
- if ((size < 0) || ((unsigned) size > io->size))
|
|
|
5975ab |
+ if (size > io->size)
|
|
|
5975ab |
size = ((io->size > GRUB_BUFIO_MAX_SIZE) ? GRUB_BUFIO_MAX_SIZE :
|
|
|
5975ab |
io->size);
|
|
|
5975ab |
|
|
|
5975ab |
@@ -88,7 +88,7 @@ grub_bufio_open (grub_file_t io, int size)
|
|
|
5975ab |
}
|
|
|
5975ab |
|
|
|
5975ab |
grub_file_t
|
|
|
5975ab |
-grub_buffile_open (const char *name, int size)
|
|
|
5975ab |
+grub_buffile_open (const char *name, grub_size_t size)
|
|
|
5975ab |
{
|
|
|
5975ab |
grub_file_t io, file;
|
|
|
5975ab |
|
|
|
5975ab |
diff --git a/include/grub/bufio.h b/include/grub/bufio.h
|
|
|
5975ab |
index acdd0c882c6..77eb8ee5672 100644
|
|
|
5975ab |
--- a/include/grub/bufio.h
|
|
|
5975ab |
+++ b/include/grub/bufio.h
|
|
|
5975ab |
@@ -22,7 +22,7 @@
|
|
|
5975ab |
|
|
|
5975ab |
#include <grub/file.h>
|
|
|
5975ab |
|
|
|
5975ab |
-grub_file_t EXPORT_FUNC (grub_bufio_open) (grub_file_t io, int size);
|
|
|
5975ab |
-grub_file_t EXPORT_FUNC (grub_buffile_open) (const char *name, int size);
|
|
|
5975ab |
+grub_file_t EXPORT_FUNC (grub_bufio_open) (grub_file_t io, grub_size_t size);
|
|
|
5975ab |
+grub_file_t EXPORT_FUNC (grub_buffile_open) (const char *name, grub_size_t size);
|
|
|
5975ab |
|
|
|
5975ab |
#endif /* ! GRUB_BUFIO_H */
|