Skip to content

Commit e682178

Browse files
committed
py/misc: Fix truncating cast.
Explicitly specify the wanted cast otherwise this results in warning C4244: '=': conversion from 'unichar' to 'char', possible loss of data when building with msvc with most warnings enabled. Signed-off-by: stijn <stijn@ignitron.net>
1 parent 1095bbb commit e682178

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/misc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static inline void vstr_ins_byte(vstr_t *vstr, size_t byte_pos, byte b) {
243243
static inline void vstr_ins_char(vstr_t *vstr, size_t char_pos, unichar chr) {
244244
// TODO UNICODE
245245
char *s = vstr_ins_blank_bytes(vstr, char_pos, 1);
246-
*s = chr;
246+
*s = (char)chr;
247247
}
248248
static inline void vstr_ins_strn(vstr_t *vstr, size_t byte_pos, const char *str, size_t len) {
249249
char *s = vstr_ins_blank_bytes(vstr, byte_pos, len);

0 commit comments

Comments
 (0)