integer->char: assure given integer range
This commit is contained in:
parent
ed354867a9
commit
32fa44db91
6
char.c
6
char.c
|
@ -31,7 +31,11 @@ pic_char_integer_to_char(pic_state *pic)
|
||||||
|
|
||||||
pic_get_args(pic, "i", &i);
|
pic_get_args(pic, "i", &i);
|
||||||
|
|
||||||
return pic_char_value(i);
|
if (i < 0 || i > 127) {
|
||||||
|
pic_errorf(pic, "integer->char: integer out of char range: %d", i);
|
||||||
|
}
|
||||||
|
|
||||||
|
return pic_char_value((char)i);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DEFINE_CHAR_CMP(op, name) \
|
#define DEFINE_CHAR_CMP(op, name) \
|
||||||
|
|
Loading…
Reference in New Issue