From 8928bc2dce125fb03cf75aca1363e6609391d6b0 Mon Sep 17 00:00:00 2001 From: dearblue Date: Tue, 12 Jan 2021 21:35:18 +0900 Subject: Initialize all area of `struct sockaddr_un` Members of `struct sockaddr_un` are requesting the definitions of `sun_family` and `sun_path`. https://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/un.h.html But the other members are optional and environment dependent. In fact, other members are defined in the BSD series. from NetBSD-9.1 ```c struct sockaddr_un { unsigned char sun_len; /* sockaddr len excluding NUL */ sa_family_t sun_family; /* AF_UNIX */ char sun_path[104]; /* path name (gag) */ }; ``` --- mrbgems/mruby-io/test/mruby_io_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mrbgems/mruby-io/test/mruby_io_test.c b/mrbgems/mruby-io/test/mruby_io_test.c index 8bc87a0d4..cf99260e2 100644 --- a/mrbgems/mruby-io/test/mruby_io_test.c +++ b/mrbgems/mruby-io/test/mruby_io_test.c @@ -80,7 +80,7 @@ mrb_io_test_io_setup(mrb_state *mrb, mrb_value self) FILE *fp; int i; #if !defined(_WIN32) && !defined(_WIN64) - struct sockaddr_un sun0; + struct sockaddr_un sun0 = { 0 }; /* Initialize them all because it is environment dependent */ #endif mrb_gv_set(mrb, mrb_intern_cstr(mrb, "$mrbtest_io_msg"), mrb_str_new_cstr(mrb, msg)); -- cgit v1.2.3