修正sprintf中\0的bug

This commit is contained in:
rtt 2017-09-07 08:45:46 -07:00
parent fa7ca39d52
commit 6b06774072
1 changed files with 4 additions and 1 deletions

View File

@ -80,7 +80,10 @@ int vprintk(char* out,int limit,const char* fmt,va_list ap){
rewid++;
}
}
if(out!=0){printch('\0',s_v,limit_n);rewid++;}
if(out!=0){
printch('\0',s_v,limit_n);
//rewid++;结尾的\0不算在返回值中
}
return rewid;
}