libstdio: fix uninitialized variables

This commit is contained in:
Giacomo Tesio 2017-05-19 01:33:09 +02:00
parent 3b4af1e4d8
commit aedc31e925
2 changed files with 5 additions and 3 deletions

View File

@ -467,6 +467,8 @@ ocvt_flt(FILE *f, va_list *args, int flags, int width, int precision,
char *eptr;
double d;
digits = nil;
eptr = nil;
echr = 'e';
fmt = afmt;
d = va_arg(*args, double);

View File

@ -300,7 +300,7 @@ Done:
static int icvt_s(FILE *f, va_list *args, int store, int width, int type){
#pragma ref type
int c, nn;
register char *s;
register char *s = nil;
if(store) s=va_arg(*args, char *);
do
c=ngetc(f);
@ -328,7 +328,7 @@ Done:
static int icvt_c(FILE *f, va_list *args, int store, int width, int type){
#pragma ref type
int c;
register char *s;
register char *s = nil;
if(store) s=va_arg(*args, char *);
if(width<0) width=1;
for(;;){
@ -360,7 +360,7 @@ static int match(int c, const char *pat){
static int icvt_sq(FILE *f, va_list *args, int store, int width, int type){
#pragma ref type
int c, nn;
register char *s;
register char *s = nil;
register const char *pat;
pat=++fmtp;
if(*fmtp=='^') fmtp++;