Commit 801da1df authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist
Browse files

Avoid a g_critical(). Pass a large enough result buffer to

2008-09-30  Tor Lillqvist  <tml@novell.com>

	* glocalfile.c (get_volume_for_path) [Win32]: Avoid a
	g_critical(). Pass a large enough result buffer to
	GetVolumePathNameW(). Just use MAX_PATH.


svn path=/trunk/; revision=7561
parent 8070d3b0
2008-09-30 Tor Lillqvist <tml@novell.com>
* glocalfile.c (get_volume_for_path) [Win32]: Avoid a
g_critical(). Pass a large enough result buffer to
GetVolumePathNameW(). Just use MAX_PATH.
2008-09-29 David Zeuthen <davidz@redhat.com>
* gvolume.c: Clarify semantics of g_volume_mount_finish() (#552168)
......
......@@ -844,10 +844,10 @@ get_volume_for_path (const char *path)
wchar_t *wpath;
wchar_t *result;
wpath = g_utf8_to_utf16 (path, -1, NULL, &len, NULL);
result = g_new (wchar_t, len + 2);
wpath = g_utf8_to_utf16 (path, -1, NULL, NULL, NULL);
result = g_new (wchar_t, MAX_PATH);
if (!GetVolumePathNameW (wpath, result, len + 2))
if (!GetVolumePathNameW (wpath, result, MAX_PATH))
{
char *msg = g_win32_error_message (GetLastError ());
g_critical ("GetVolumePathName failed: %s", msg);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment