X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=avahi-sharp%2FUtility.cs;h=a1d0a669ed66608069eafe0297f9533e2a0ad06e;hb=76256da5f1fc4afe60ff95bd8a98b9a41fa3e148;hp=e088e244667b257c00062798626579dcc317ffb3;hpb=6cc9575148671ed743b86687b0d7e1b876a99114;p=catta diff --git a/avahi-sharp/Utility.cs b/avahi-sharp/Utility.cs index e088e24..a1d0a66 100644 --- a/avahi-sharp/Utility.cs +++ b/avahi-sharp/Utility.cs @@ -1,5 +1,3 @@ -/* $Id$ */ - /*** This file is part of avahi. @@ -26,6 +24,8 @@ using System.Runtime.InteropServices; using Mono.Unix; using Mono.Unix.Native; +using Stdlib = Mono.Unix.Native.Stdlib; + namespace Avahi { internal class Utility @@ -43,7 +43,7 @@ namespace Avahi { if (ptr == IntPtr.Zero) return null; - + int len = strlen (ptr); byte[] bytes = new byte[len]; Marshal.Copy (ptr, bytes, 0, len); @@ -54,7 +54,7 @@ namespace Avahi { if (ptr == IntPtr.Zero) return null; - + string ret = PtrToString (ptr); Free (ptr); return ret; @@ -98,7 +98,7 @@ namespace Avahi public static IPAddress PtrToAddress (IntPtr ptr) { IPAddress address = null; - + if (ptr != IntPtr.Zero) { IntPtr buf = Stdlib.malloc (256); IntPtr addrPtr = avahi_address_snprint (buf, 256, ptr);