Fix issues by adding support for floating point values in va_list
This commit is contained in:
@@ -36,7 +36,7 @@ pub unsafe fn printf<W: fmt::Write>(mut w: W, format: *const c_char, mut ap: VaL
|
||||
found_percent = false;
|
||||
}
|
||||
'f' | 'F' => {
|
||||
let a: f64 = mem::transmute(ap.get::<u64>());
|
||||
let a = ap.get::<f64>();
|
||||
|
||||
w.write_fmt(format_args!("{}", a));
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
double d = atof("1.0");
|
||||
double d = atof("-3.14");
|
||||
printf("%f\n", d);
|
||||
return 0;
|
||||
}
|
||||
|
||||
+1
-1
Submodule va_list updated: 4762a18450...1945668b2f
Reference in New Issue
Block a user