Navigation Menu

Skip to content

Commit

Permalink
Remove wcrtomb because memset seems to be enough to initialize mbstate_t
Browse files Browse the repository at this point in the history
This change suppresses the following warning (gcc):
  groonga.c: In function ‘line_editor_fgets’:
  groonga.c:218:5: warning: ignoring return value of ‘wcrtomb’, declared with attribute warn_unused_result [-Wunused-result]
       wcrtomb(NULL, L'\0', &ps);
       ^
  • Loading branch information
s-yata committed Feb 9, 2018
1 parent 4e752e7 commit fec6cc6
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/groonga.c
Expand Up @@ -215,7 +215,6 @@ line_editor_fgets(grn_ctx *ctx, grn_obj *buf)
mbstate_t ps;
history_w(line_editor_history, &line_editor_history_event, H_ENTER, line);
memset(&ps, 0, sizeof(ps));
wcrtomb(NULL, L'\0', &ps);
for (i = 0; i < nchar; i++) {
multibyte_len = wcrtomb(multibyte_buf, line[i], &ps);
if (multibyte_len == (size_t)-1) {
Expand Down

0 comments on commit fec6cc6

Please sign in to comment.