bugfix in pic_get_args

This commit is contained in:
Yuichi Nishiwaki 2013-10-28 00:33:24 +09:00
parent 90b691be67
commit 5133e04c39
1 changed files with 11 additions and 2 deletions

View File

@ -53,8 +53,17 @@ pic_get_args(pic_state *pic, const char *format, ...)
f = va_arg(ap, double *);
if (i < argc) {
*f = pic_float(GET_OPERAND(pic,i));
i++;
pic_value v;
v = GET_OPERAND(pic, i);
if (pic_type(v) == PIC_TT_FLOAT) {
*f = pic_float(v);
i++;
}
else {
*f = pic_int(v);
i++;
}
}
}
break;