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

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2007-12-05 18:10:20 +0300
committerCorinna Vinschen <corinna@vinschen.de>2007-12-05 18:10:20 +0300
commit5224a7bbf34a50c03d630dd02bfd636ff88583c0 (patch)
tree65a62de501eef144361a4fe5bc23f9c1b6bf2658 /winsup/cygwin/registry.cc
parent8c7c7178c7ca377ff09c3226320b0f8985814bd4 (diff)
* fhandler_registry.cc: Use NAME_MAX + 1 instead of CYG_MAX_PATH
throughout for subkey name buffer size. * fhandler_socket.cc (search_wsa_event_slot): Use MAX_PATH instead of CYG_MAX_PATH for mutext name buffer size. (fhandler_socket::init_events): Ditto. * fhandler_virtual.cc (fhandler_virtual::opendir): Check path length against PATH_MAX instead of against CYG_MAX_PATH. * registry.cc (get_registry_hive_path): Use PATH_MAX instead of CYG_MAX_PATH for registry value path buffer size. * shared.cc (open_shared): Use MAX_PATH instead of CYG_MAX_PATH for shared memory name buffer size. * thread.cc (semaphore::semaphore): Use MAX_PATH instead of CYG_MAX_PATH for semaphore name buffer size. * uinfo.cc (cygheap_user::env_userprofile): Use PATH_MAX instead of CYG_MAX_PATH for temporary path name buffer size. * winf.h (LINE_BUF_CHUNK): Define as MAX_PATH * 2. * include/sys/dirent.h: Include sys/limits.h. Define name buffer sizes using NAME_MAX.
Diffstat (limited to 'winsup/cygwin/registry.cc')
-rw-r--r--winsup/cygwin/registry.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/winsup/cygwin/registry.cc b/winsup/cygwin/registry.cc
index 1c15aa553..3c67ff62f 100644
--- a/winsup/cygwin/registry.cc
+++ b/winsup/cygwin/registry.cc
@@ -219,13 +219,13 @@ get_registry_hive_path (const char *name, char *path)
"ProfileList\\%s", name);
if (!RegOpenKeyExA (HKEY_LOCAL_MACHINE, key, 0, KEY_READ, &hkey))
{
- char buf[256];
+ char buf[PATH_MAX];
DWORD type, siz;
path[0] = '\0';
if (!RegQueryValueExA (hkey, "ProfileImagePath", 0, &type,
(BYTE *)buf, (siz = sizeof (buf), &siz)))
- ExpandEnvironmentStringsA (buf, path, CYG_MAX_PATH);
+ ExpandEnvironmentStringsA (buf, path, PATH_MAX);
RegCloseKey (hkey);
if (path[0])
return path;
@@ -237,7 +237,7 @@ get_registry_hive_path (const char *name, char *path)
void
load_registry_hive (const char * name)
{
- char path[CYG_MAX_PATH];
+ char path[PATH_MAX];
HKEY hkey;
LONG ret;