diff --git a/bindings/dotnet/src/Sigar.cs b/bindings/dotnet/src/Sigar.cs index 2291f90a..c2aad542 100644 --- a/bindings/dotnet/src/Sigar.cs +++ b/bindings/dotnet/src/Sigar.cs @@ -48,13 +48,13 @@ namespace Hyperic.Sigar { } [DllImport(Sigar.LIBSIGAR)] - private static extern string + private static extern void sigar_format_size(ulong size, StringBuilder buffer); public static string FormatSize(ulong size) { - StringBuilder buffer = new StringBuilder(); - buffer.Capacity = 56; - return sigar_format_size(size, buffer); + StringBuilder buffer = new StringBuilder(56); + sigar_format_size(size, buffer); + return buffer.ToString(); } public Mem Mem() {