projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add M4 macros helpers to build Java programs
[lttng-ust.git]
/
snprintf
/
snprintf.c
diff --git
a/snprintf/snprintf.c
b/snprintf/snprintf.c
index b0ea5d3b0373cd46e282335d303beb136e1f21f4..a6263979fb0f3392ef0371693a85369169e25353 100644
(file)
--- a/
snprintf/snprintf.c
+++ b/
snprintf/snprintf.c
@@
-38,20
+38,22
@@
#include "local.h"
#include "ust_snprintf.h"
#include "local.h"
#include "ust_snprintf.h"
+#define DUMMY_LEN 1
+
int ust_safe_vsnprintf(char *str, size_t n, const char *fmt, va_list ap)
{
int ret;
int ust_safe_vsnprintf(char *str, size_t n, const char *fmt, va_list ap)
{
int ret;
- char dummy;
- LFILE f;
- struct __sfileext fext;
+ char dummy
[DUMMY_LEN]
;
+ L
TTNG_UST_L
FILE f;
+ struct __
lttng_ust_
sfileext fext;
/* While snprintf(3) specifies size_t stdio uses an int internally */
if (n > INT_MAX)
n = INT_MAX;
/* Stdio internals do not deal correctly with zero length buffer */
if (n == 0) {
/* While snprintf(3) specifies size_t stdio uses an int internally */
if (n > INT_MAX)
n = INT_MAX;
/* Stdio internals do not deal correctly with zero length buffer */
if (n == 0) {
- str =
&
dummy;
- n =
1
;
+ str = dummy;
+ n =
DUMMY_LEN
;
}
_FILEEXT_SETUP(&f, &fext);
f._file = -1;
}
_FILEEXT_SETUP(&f, &fext);
f._file = -1;
This page took
0.023951 seconds
and
4
git commands to generate.