Fix issues by adding support for floating point values in va_list

This commit is contained in:
Jeremy Soller
2018-03-08 20:54:46 -07:00
parent 56e304a2af
commit a95a034219
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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
View File
@@ -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