lkml.org 
[lkml]   [2005]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] vsprintf.c cleanups
- Make sprintf call vsnprintf directly
- use INT_MAX for sprintf and vsprintf

Signed-off-by: Brian Gerst <bgerst@didntduck.org>

vsprintf.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff -urN linux-2.6.11-rc5/lib/vsprintf.c linux/lib/vsprintf.c
--- linux-2.6.11-rc5/lib/vsprintf.c 2004-08-24 08:43:15.000000000 -0400
+++ linux/lib/vsprintf.c 2005-02-24 17:59:28.000000000 -0500
@@ -580,7 +580,7 @@
*/
int vsprintf(char *buf, const char *fmt, va_list args)
{
- return vsnprintf(buf, (~0U)>>1, fmt, args);
+ return vsnprintf(buf, INT_MAX, fmt, args);
}

EXPORT_SYMBOL(vsprintf);
@@ -601,7 +601,7 @@
int i;

va_start(args, fmt);
- i=vsprintf(buf,fmt,args);
+ i=vsnprintf(buf, INT_MAX, fmt, args);
va_end(args);
return i;
}
\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.045 / U:0.696 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site