vsprintf: fix data type of variable in string_nocheck()
diff mbox series

Message ID 040301d51f60$b4959100$1dc0b300$@samsung.com
State Accepted
Commit b314dd49a28a38997aa8f472d02f0631a830d37a
Headers show
Series
  • vsprintf: fix data type of variable in string_nocheck()
Related show

Commit Message

남영민 June 10, 2019, 7:47 a.m. UTC
This patch fixes data type of precision with int.
The precision is declared as signed int in struct printf_spec.

Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
---
 lib/vsprintf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sergey Senozhatsky June 10, 2019, 8:16 a.m. UTC | #1
On (06/10/19 16:47), 남영민 wrote:
> This patch fixes data type of precision with int.
> The precision is declared as signed int in struct printf_spec.
> 
> Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>

Looks OK to me.

FWIW
Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

	-ss
Petr Mladek June 12, 2019, 7:56 a.m. UTC | #2
On Mon 2019-06-10 17:16:54, Sergey Senozhatsky wrote:
> On (06/10/19 16:47), 남영민 wrote:
> > This patch fixes data type of precision with int.
> > The precision is declared as signed int in struct printf_spec.
> > 
> > Signed-off-by: Youngmin Nam <youngmin.nam@samsung.com>
> 
> Looks OK to me.
> 
> FWIW
> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

The patch has been committed into printk.git, branch for-5.3.

Best Regards,
Petr

Patch
diff mbox series

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 63937044c57d..cd0cd9279b12 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -599,7 +599,7 @@  static char *string_nocheck(char *buf, char *end, const char *s,
 			    struct printf_spec spec)
 {
 	int len = 0;
-	size_t lim = spec.precision;
+	int lim = spec.precision;
 
 	while (lim--) {
 		char c = *s++;