mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] vsprintf: fix handling of strp arg in asprintf
@ 2016-07-06  7:52 Enrico Jorns
  2016-07-07  7:17 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Enrico Jorns @ 2016-07-06  7:52 UTC (permalink / raw)
  To: barebox; +Cc: Enrico Jorns

strp argument was ignored but should be forwarded to vasprintf() call in
order to make this funktion work as expected.

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
---
 lib/vsprintf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 1122a4a..f3885a8 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -684,11 +684,10 @@ EXPORT_SYMBOL(bvasprintf);
 int asprintf(char **strp, const char *fmt, ...)
 {
 	va_list ap;
-	char *p;
 	int len;
 
 	va_start(ap, fmt);
-	len = vasprintf(&p, fmt, ap);
+	len = vasprintf(strp, fmt, ap);
 	va_end(ap);
 
 	return len;
-- 
2.8.1


_______________________________________________
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 handling of strp arg in asprintf
  2016-07-06  7:52 [PATCH] vsprintf: fix handling of strp arg in asprintf Enrico Jorns
@ 2016-07-07  7:17 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2016-07-07  7:17 UTC (permalink / raw)
  To: Enrico Jorns; +Cc: barebox

On Wed, Jul 06, 2016 at 09:52:52AM +0200, Enrico Jorns wrote:
> strp argument was ignored but should be forwarded to vasprintf() call in
> order to make this funktion work as expected.
> 
> Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
> ---
>  lib/vsprintf.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 

Applied, thanks

Sascha

> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index 1122a4a..f3885a8 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -684,11 +684,10 @@ EXPORT_SYMBOL(bvasprintf);
>  int asprintf(char **strp, const char *fmt, ...)
>  {
>  	va_list ap;
> -	char *p;
>  	int len;
>  
>  	va_start(ap, fmt);
> -	len = vasprintf(&p, fmt, ap);
> +	len = vasprintf(strp, fmt, ap);
>  	va_end(ap);
>  
>  	return len;
> -- 
> 2.8.1
> 
> 
> _______________________________________________
> 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:[~2016-07-07  7:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-06  7:52 [PATCH] vsprintf: fix handling of strp arg in asprintf Enrico Jorns
2016-07-07  7:17 ` Sascha Hauer

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