[PATCH 48/72] libmultipath: print: use unsigned int for "width" field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Martin Wilck <mwilck@xxxxxxxx>

Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>
---
 libmultipath/print.c | 4 ++--
 libmultipath/print.h | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libmultipath/print.c b/libmultipath/print.c
index 8fa86267..b98e9bda 100644
--- a/libmultipath/print.c
+++ b/libmultipath/print.c
@@ -36,7 +36,7 @@
 #define NOPAD    s = c
 #define PAD(x) \
 do { \
-	while ((int)(c - s) < (x) && (c < (line + len - 1))) \
+	while (c < (s + x) && (c < (line + len - 1))) \
 		*c++ = ' '; \
 	s = c; \
 } while (0)
@@ -783,7 +783,7 @@ get_path_layout(vector pathvec, int header)
 }
 
 static void
-reset_width(int *width, enum layout_reset reset, const char *header)
+reset_width(unsigned int *width, enum layout_reset reset, const char *header)
 {
 	switch (reset) {
 	case LAYOUT_RESET_HEADER:
diff --git a/libmultipath/print.h b/libmultipath/print.h
index 0c909e75..e8260d03 100644
--- a/libmultipath/print.h
+++ b/libmultipath/print.h
@@ -78,21 +78,21 @@
 struct path_data {
 	char wildcard;
 	char * header;
-	int width;
+	unsigned int width;
 	int (*snprint)(char * buff, size_t len, const struct path * pp);
 };
 
 struct multipath_data {
 	char wildcard;
 	char * header;
-	int width;
+	unsigned int width;
 	int (*snprint)(char * buff, size_t len, const struct multipath * mpp);
 };
 
 struct pathgroup_data {
 	char wildcard;
 	char * header;
-	int width;
+	unsigned int width;
 	int (*snprint)(char * buff, size_t len, const struct pathgroup * pgp);
 };
 
-- 
2.23.0


--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux