Subversion Repositories HelenOS

Rev

Rev 2479 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2479 Rev 4482
Line 35... Line 35...
35
#include <stdarg.h>
35
#include <stdarg.h>
36
#include <stdio.h>
36
#include <stdio.h>
37
#include <io/printf_core.h>
37
#include <io/printf_core.h>
38
 
38
 
39
/** Print formatted to the given buffer with limited size.
39
/** Print formatted to the given buffer with limited size.
-
 
40
 *
40
 * @param str   buffer
41
 * @param str  Buffer
41
 * @param size  buffer size
42
 * @param size Buffer size
42
 * @param fmt   format string
43
 * @param fmt  Format string
-
 
44
 *
43
 * \see For more details about format string see printf_core.
45
 * \see For more details about format string see printf_core.
-
 
46
 *
44
 */
47
 */
45
int snprintf(char *str, size_t size, const char *fmt, ...)
48
int snprintf(char *str, size_t size, const char *fmt, ...)
46
{
49
{
47
    int ret;
-
 
48
    va_list args;
50
    va_list args;
49
   
-
 
50
    va_start(args, fmt);
51
    va_start(args, fmt);
-
 
52
   
51
    ret = vsnprintf(str, size, fmt, args);
53
    int ret = vsnprintf(str, size, fmt, args);
52
 
54
   
53
    va_end(args);
55
    va_end(args);
54
 
56
   
55
    return ret;
57
    return ret;
56
}
58
}
57
 
59
 
58
/** @}
60
/** @}
59
 */
61
 */