on master help sign in
vty_init_custom_table: default to 1 for widths of unknown code points
commit24b9c8c0f53a4c6cc22fff6df1e9098f50993de5 authorJonathan Daugherty <cygnus@foobox.com> dateThu 5 Mar 2020, 14:19 (7 years ago) parenta2d9c0a
1 file changed+2−2
cbits/mk_wcwidth.c+2−2
cbits/mk_wcwidth.c+2−2
@@ -249,7 +249,7 @@ HsInt vty_mk_wcwidth(HsChar ch)
249249// This allocates a new character width table of the specified size
250250// (in characters). If a custom table has already been allocated, this
251251// returns 1. Otherwise it allocates a new table, initializes all of its
252−// entries to zero, and returns zero.
252+// entries to 1, and returns zero.
253253//
254254// Note that this does *not* mark the table as ready for use. Until the
255255// table is marked ready, it will not be used by vty_mk_wcwidth. To mark
@@ -261,7 +261,7 @@ int vty_init_custom_table(int size)
261261 if (size > 0 && size <= MAX_CUSTOM_TABLE_SIZE) {
262262 custom_table_ready = 0;
263263 custom_table = malloc(size);
264− bzero(custom_table, size);
264+ memset(custom_table, 1, size);
265265 custom_table_size = size;
266266 return 0;
267267 } else {