Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs')
-rw-r--r--mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs b/mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs
index ec013013cfd..302cc59f580 100644
--- a/mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs
+++ b/mcs/class/Mono.Posix/Mono.Unix/UnixMarshal.cs
@@ -67,6 +67,7 @@ namespace Mono.Unix {
try {
Translate = new ErrorTranslator (strerror_r);
string ignore = Translate (Error.EPERM);
+ ignore = ignore;
HaveStrerror_r = true;
}
catch (EntryPointNotFoundException e) {
@@ -161,11 +162,9 @@ namespace Mono.Unix {
private static int CountStrings (IntPtr stringArray)
{
- int count = -1;
- IntPtr item = Marshal.ReadIntPtr (stringArray, count * IntPtr.Size);
- do {
+ int count = 0;
+ while (Marshal.ReadIntPtr (stringArray, count*IntPtr.Size) != IntPtr.Zero)
++count;
- } while (Marshal.ReadIntPtr (stringArray, count * IntPtr.Size) != IntPtr.Zero);
return count;
}