Commit dce252ce authored by Brian Gerst's avatar Brian Gerst Committed by Linus Torvalds

[PATCH] vsprintf.c cleanups

- Make sprintf call vsnprintf directly
- use INT_MAX for sprintf and vsprintf
Signed-off-by: default avatarBrian Gerst <bgerst@didntduck.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 52eab33a
......@@ -580,7 +580,7 @@ EXPORT_SYMBOL(scnprintf);
*/
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 sprintf(char * buf, const char *fmt, ...)
int i;
va_start(args, fmt);
i=vsprintf(buf,fmt,args);
i=vsnprintf(buf, INT_MAX, fmt, args);
va_end(args);
return i;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment