diff mbox series

[v2,2/3] test: Fix size_t formats in strlcat test

Message ID 20210719010242.804345-2-sjg@chromium.org
State Accepted
Commit 35eab76494a78173ddf71f6e9ff9d9144048b7ee
Delegated to: Minkyu Kang
Headers show
Series [v2,1/3] samsung: exynos: Convert SROMC interface to a driver | expand

Commit Message

Simon Glass July 19, 2021, 1:02 a.m. UTC
Some of the printf() formats do not match their types. Fix this.

Reported-by: Minkyu Kang <promsoft@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2:
- Fix some size_t warnings with recent compilers

 test/lib/strlcat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Minkyu Kang July 30, 2021, 4:58 a.m. UTC | #1
Dear Simon Glass,

On Mon, 19 Jul 2021 at 10:02, Simon Glass <sjg@chromium.org> wrote:

> Some of the printf() formats do not match their types. Fix this.
>
> Reported-by: Minkyu Kang <promsoft@gmail.com>
>

I modified email address to mk7.kang@samsung.com : )

Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> Changes in v2:
> - Fix some size_t warnings with recent compilers
>
>  test/lib/strlcat.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/test/lib/strlcat.c b/test/lib/strlcat.c
> index ee61684c405..a0ec037388b 100644
> --- a/test/lib/strlcat.c
> +++ b/test/lib/strlcat.c
> @@ -48,7 +48,7 @@ static int do_test_strlcat(struct unit_test_state *uts,
> int line, size_t align1,
>         if (expected != actual) {
>                 ut_failf(uts, __FILE__, line, __func__,
>                          "strlcat(s2, s1, 2) == len2 < n ? min(len1 +
> len2, n) : n",
> -                        "Expected %#lx (%ld), got %#lx (%ld)",
> +                        "Expected %#zx (%zd), got %#zx (%zd)",
>                          expected, expected, actual, actual);
>                 return CMD_RET_FAILURE;
>         }
> @@ -66,7 +66,7 @@ static int do_test_strlcat(struct unit_test_state *uts,
> int line, size_t align1,
>         if (len2 < n && s2[i] != '\0') {
>                 ut_failf(uts, __FILE__, line, __func__,
>                          "n < len1 && s2[len2 + n] == '\\0'",
> -                        "Expected s2[%ld] = '\\0', got %d ('%c')",
> +                        "Expected s2[%zd] = '\\0', got %d ('%c')",
>                          i, s2[i], s2[i]);
>                 return CMD_RET_FAILURE;
>         }
> --
> 2.32.0.402.g57bb445576-goog
>
>
applied to u-boot-samsung.
diff mbox series

Patch

diff --git a/test/lib/strlcat.c b/test/lib/strlcat.c
index ee61684c405..a0ec037388b 100644
--- a/test/lib/strlcat.c
+++ b/test/lib/strlcat.c
@@ -48,7 +48,7 @@  static int do_test_strlcat(struct unit_test_state *uts, int line, size_t align1,
 	if (expected != actual) {
 		ut_failf(uts, __FILE__, line, __func__,
 			 "strlcat(s2, s1, 2) == len2 < n ? min(len1 + len2, n) : n",
-			 "Expected %#lx (%ld), got %#lx (%ld)",
+			 "Expected %#zx (%zd), got %#zx (%zd)",
 			 expected, expected, actual, actual);
 		return CMD_RET_FAILURE;
 	}
@@ -66,7 +66,7 @@  static int do_test_strlcat(struct unit_test_state *uts, int line, size_t align1,
 	if (len2 < n && s2[i] != '\0') {
 		ut_failf(uts, __FILE__, line, __func__,
 			 "n < len1 && s2[len2 + n] == '\\0'",
-			 "Expected s2[%ld] = '\\0', got %d ('%c')",
+			 "Expected s2[%zd] = '\\0', got %d ('%c')",
 			 i, s2[i], s2[i]);
 		return CMD_RET_FAILURE;
 	}