Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
9fd215b0
Commit
9fd215b0
authored
Jan 27, 2016
by
Johny Mattsson
Browse files
Corrected sprintf() prototype & behaviour.
parent
74d27b34
Changes
2
Show whitespace changes
Inline
Side-by-side
app/libc/c_stdio.c
View file @
9fd215b0
...
@@ -1094,12 +1094,14 @@ exponent(char *p, int exp, int fmtch)
...
@@ -1094,12 +1094,14 @@ exponent(char *p, int exp, int fmtch)
#endif
/* FLOATINGPT */
#endif
/* FLOATINGPT */
void
c_sprintf
(
char
*
s
,
char
*
fmt
,
...)
int
c_sprintf
(
char
*
s
,
const
char
*
fmt
,
...)
{
{
int
n
;
va_list
arg
;
va_list
arg
;
va_start
(
arg
,
fmt
);
va_start
(
arg
,
fmt
);
vsprintf
(
s
,
fmt
,
arg
);
n
=
vsprintf
(
s
,
fmt
,
arg
);
va_end
(
arg
);
va_end
(
arg
);
return
n
;
}
}
#endif
#endif
app/libc/c_stdio.h
View file @
9fd215b0
...
@@ -60,7 +60,7 @@ extern void output_redirect(const char *str);
...
@@ -60,7 +60,7 @@ extern void output_redirect(const char *str);
#define c_sprintf os_sprintf
#define c_sprintf os_sprintf
#else
#else
#include "c_stdarg.h"
#include "c_stdarg.h"
void
c_sprintf
(
char
*
s
,
char
*
fmt
,
...);
int
c_sprintf
(
char
*
s
,
const
char
*
fmt
,
...);
#endif
#endif
// #define c_vsprintf ets_vsprintf
// #define c_vsprintf ets_vsprintf
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment