diff --git a/bindings/ruby/examples/netstat.rb b/bindings/ruby/examples/netstat.rb index cc820756..9903f281 100644 --- a/bindings/ruby/examples/netstat.rb +++ b/bindings/ruby/examples/netstat.rb @@ -14,7 +14,7 @@ def format_port(sigar, proto, port, is_numeric) end if !is_numeric service = sigar.net_services_name(proto, port) - if service != false + if service != nil return service end end diff --git a/bindings/ruby/rbsigar.c b/bindings/ruby/rbsigar.c index ed462c64..56491cbb 100644 --- a/bindings/ruby/rbsigar.c +++ b/bindings/ruby/rbsigar.c @@ -212,7 +212,7 @@ static VALUE rb_sigar_net_services_name(VALUE obj, VALUE protocol, VALUE port) return rb_str_new2(name); } else { - Qnil; + return Qnil; } }