mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] vsprintf: fix formatting
@ 2014-05-22  5:20 Antony Pavlov
  2014-05-22  6:12 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Antony Pavlov @ 2014-05-22  5:20 UTC (permalink / raw)
  To: barebox

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 lib/vsprintf.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index c73db73..066338b 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -370,7 +370,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
 		/* get the precision */
 		precision = -1;
 		if (*fmt == '.') {
-			++fmt;	
+			++fmt;
 			if (isdigit(*fmt))
 				precision = skip_atoi(&fmt);
 			else if (*fmt == '*') {
@@ -534,7 +534,8 @@ int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
 {
 	int i;
 
-	i=vsnprintf(buf,size,fmt,args);
+	i = vsnprintf(buf, size, fmt, args);
+
 	return (i >= size) ? (size - 1) : i;
 }
 EXPORT_SYMBOL(vscnprintf);
@@ -566,13 +567,13 @@ int sprintf(char * buf, const char *fmt, ...)
 	int i;
 
 	va_start(args, fmt);
-	i=vsprintf(buf,fmt,args);
+	i = vsprintf(buf, fmt, args);
 	va_end(args);
 	return i;
 }
 EXPORT_SYMBOL(sprintf);
 
-int snprintf(char * buf, size_t size, const char *fmt, ...)
+int snprintf(char *buf, size_t size, const char *fmt, ...)
 {
 	va_list args;
 	int i;
@@ -620,7 +621,7 @@ EXPORT_SYMBOL(asprintf);
 
 void __noreturn panic(const char *fmt, ...)
 {
-	va_list	args;
+	va_list args;
 	va_start(args, fmt);
 	vprintf(fmt, args);
 	putchar('\n');
-- 
1.9.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] vsprintf: fix formatting
  2014-05-22  5:20 [PATCH] vsprintf: fix formatting Antony Pavlov
@ 2014-05-22  6:12 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2014-05-22  6:12 UTC (permalink / raw)
  To: Antony Pavlov; +Cc: barebox

On Thu, May 22, 2014 at 09:20:04AM +0400, Antony Pavlov wrote:
> Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>

Applied, thanks

Sascha

> ---
>  lib/vsprintf.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index c73db73..066338b 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -370,7 +370,7 @@ int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
>  		/* get the precision */
>  		precision = -1;
>  		if (*fmt == '.') {
> -			++fmt;	
> +			++fmt;
>  			if (isdigit(*fmt))
>  				precision = skip_atoi(&fmt);
>  			else if (*fmt == '*') {
> @@ -534,7 +534,8 @@ int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
>  {
>  	int i;
>  
> -	i=vsnprintf(buf,size,fmt,args);
> +	i = vsnprintf(buf, size, fmt, args);
> +
>  	return (i >= size) ? (size - 1) : i;
>  }
>  EXPORT_SYMBOL(vscnprintf);
> @@ -566,13 +567,13 @@ int sprintf(char * buf, const char *fmt, ...)
>  	int i;
>  
>  	va_start(args, fmt);
> -	i=vsprintf(buf,fmt,args);
> +	i = vsprintf(buf, fmt, args);
>  	va_end(args);
>  	return i;
>  }
>  EXPORT_SYMBOL(sprintf);
>  
> -int snprintf(char * buf, size_t size, const char *fmt, ...)
> +int snprintf(char *buf, size_t size, const char *fmt, ...)
>  {
>  	va_list args;
>  	int i;
> @@ -620,7 +621,7 @@ EXPORT_SYMBOL(asprintf);
>  
>  void __noreturn panic(const char *fmt, ...)
>  {
> -	va_list	args;
> +	va_list args;
>  	va_start(args, fmt);
>  	vprintf(fmt, args);
>  	putchar('\n');
> -- 
> 1.9.2
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-22  6:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-22  5:20 [PATCH] vsprintf: fix formatting Antony Pavlov
2014-05-22  6:12 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox