projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
filter: bytecode already in the list should go before
[lttng-ust.git]
/
snprintf
/
snprintf.c
diff --git
a/snprintf/snprintf.c
b/snprintf/snprintf.c
index bbc66a0743982a6bde5a925a689dbbaa4a7a441e..68b45776346159b8ce9f9e7e9a8f0f9fba3728ee 100644
(file)
--- a/
snprintf/snprintf.c
+++ b/
snprintf/snprintf.c
@@
-32,16
+32,19
@@
*/
#include <limits.h>
*/
#include <limits.h>
+#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "local.h"
#include "ust_snprintf.h"
#include <stdio.h>
#include <string.h>
#include <stdarg.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;
+ char dummy
[DUMMY_LEN]
;
LTTNG_UST_LFILE f;
struct __lttng_ust_sfileext fext;
LTTNG_UST_LFILE f;
struct __lttng_ust_sfileext fext;
@@
-50,8
+53,8
@@
int ust_safe_vsnprintf(char *str, size_t n, const char *fmt, va_list ap)
n = INT_MAX;
/* Stdio internals do not deal correctly with zero length buffer */
if (n == 0) {
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.024949 seconds
and
4
git commands to generate.