mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Resolve sign comparison warning; ref #4044
This commit is contained in:
@@ -223,7 +223,7 @@ mrb_addrinfo_unix_path(mrb_state *mrb, mrb_value self)
|
||||
sastr = mrb_iv_get(mrb, self, mrb_intern_lit(mrb, "@sockaddr"));
|
||||
if (((struct sockaddr *)RSTRING_PTR(sastr))->sa_family != AF_UNIX)
|
||||
mrb_raise(mrb, E_SOCKET_ERROR, "need AF_UNIX address");
|
||||
if (RSTRING_LEN(sastr) < offsetof(struct sockaddr_un, sun_path) + 1) {
|
||||
if (RSTRING_LEN(sastr) < (mrb_int)offsetof(struct sockaddr_un, sun_path) + 1) {
|
||||
return mrb_str_new(mrb, "", 0);
|
||||
} else {
|
||||
return mrb_str_new_cstr(mrb, ((struct sockaddr_un *)RSTRING_PTR(sastr))->sun_path);
|
||||
|
||||
Reference in New Issue
Block a user