Fixed incorrect buffer length in GetUNCServer (#78)

pull/83/head
David Hall 2019-12-17 20:04:02 -07:00
parent 1ee34f1001
commit 4096345176
1 changed files with 1 additions and 1 deletions

View File

@ -182,7 +182,7 @@ namespace Vanara.IO
/// </summary>
/// <param name="path">The UNC path.</param>
/// <returns>On success, the server portion of the UNC path. On failure, <see langword="null"/> is returned.</returns>
public static string GetUNCServer(string path) => PathIsUNCEx(path, out var ptr) ? StringHelper.GetString(ptr, System.Runtime.InteropServices.CharSet.Unicode, path.Length) : null;
public static string GetUNCServer(string path) => PathIsUNCEx(path, out var ptr) ? StringHelper.GetString(ptr, System.Runtime.InteropServices.CharSet.Unicode, (path.Length + 1) * 2) : null;
/// <summary>
/// Searches a path to determine if it contains a valid prefix of the type passed by <paramref name="prefix"/>. A prefix is one of