vfs: check userland buffers before reading them.
[haiku.git] / src / tools / fs_shell / stdio.cpp
blob3ae571838353415806f0a5027649646f3c71b8b4
1 /*
2 * Copyright 2007, Ingo Weinhold, bonefish@cs.tu-berlin.de.
3 * Distributed under the terms of the MIT License.
4 */
6 #include "fssh_stdio.h"
8 #include <stdio.h>
9 #include <stdlib.h>
12 int
13 fssh_sprintf(char *string, char const *format, ...)
15 va_list args;
16 va_start(args, format);
18 int result = vsprintf(string, format, args);
20 va_end(args);
22 return result;
26 int
27 fssh_snprintf(char *string, fssh_size_t size, char const *format, ...)
29 va_list args;
30 va_start(args, format);
32 int result = vsnprintf(string, size, format, args);
34 va_end(args);
36 return result;
40 int
41 fssh_vsprintf(char *string, char const *format, va_list ap)
43 return vsprintf(string, format, ap);
47 int
48 fssh_vsnprintf(char *string, fssh_size_t size, char const *format, va_list ap)
50 return vsnprintf(string, size, format, ap);