throw an error when finding invalid argument specifier

This commit is contained in:
Yuichi Nishiwaki 2013-10-22 17:44:47 +09:00
parent 779199d571
commit 828606aed5
2 changed files with 5 additions and 1 deletions

View File

@ -198,7 +198,7 @@ pic_number_atan(pic_state *pic)
double f,g;
int argc;
argc = pic_get_args(pic, "f|g", &f, &g);
argc = pic_get_args(pic, "f|f", &f, &g);
if (argc == 1) {
f = atan(f);
return pic_float_value(f);

View File

@ -74,6 +74,10 @@ pic_get_args(pic_state *pic, const char *format, ...)
}
}
break;
default:
{
pic_error(pic, "pic_get_args: invalid argument specifier given");
}
}
}
if (argc > i) {