From 36093cfbbfaaa714ef049265d91bbde67d889e2c Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 6 Dec 2007 18:24:06 +0000 Subject: * dcrt0.cc (initial_env): Use PATH_MAX instead of CYG_MAX_PATH for path name buffer size. (dll_crt0_1): Allocate new_argv0 with PATH_MAX size. * exceptions.cc (debugger_command): Set size to 2 * PATH_MAX + 20; (error_start_init): Use PATH_MAX instead of CYG_MAX_PATH for path name buffer size. * external.cc (fillout_pinfo): Always fill out ep.progname 0-terminated. Fill out ep.progname_long. * fhandler_process.cc (fhandler_process::fill_filebuf): Allocate buffer for executable filename with PATH_MAX size. * pinfo.cc: Throughout use PATH_MAX instead of CYG_MAX_PATH. * pinfo.h (class _pinfo): Set progname size to PATH_MAX. * smallprint.cc: Include limits.h. Use PATH_MAX instead of CYG_MAX_PATH for path name buffer size. * strace.cc (strace::vsprntf): Ditto. * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION_32_LP): Define. (EXTERNAL_PINFO_VERSION): Set to EXTERNAL_PINFO_VERSION_32_LP. (struct external_pinfo): Add progname_long member. * include/sys/dirent.h: Correctly include limits.h instead of sys/limits.h. --- winsup/cygwin/smallprint.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/smallprint.cc') diff --git a/winsup/cygwin/smallprint.cc b/winsup/cygwin/smallprint.cc index bdf50288b..9208947e2 100644 --- a/winsup/cygwin/smallprint.cc +++ b/winsup/cygwin/smallprint.cc @@ -13,6 +13,7 @@ details. */ #include #include #include +#include #define LLMASK (0xffffffffffffffffULL) #define LMASK (0xffffffff) @@ -63,7 +64,7 @@ __rn (char *dst, int base, int dosign, long long val, int len, int pad, unsigned extern "C" int __small_vsprintf (char *dst, const char *fmt, va_list ap) { - char tmp[CYG_MAX_PATH + 1]; + char tmp[PATH_MAX]; char *orig = dst; const char *s; PWCHAR w; @@ -168,7 +169,7 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap) dst = rnargLL (dst, 16, 0, len, pad); break; case 'P': - if (!GetModuleFileName (NULL, tmp, CYG_MAX_PATH)) + if (!GetModuleFileName (NULL, tmp, PATH_MAX)) s = "cygwin program"; else s = tmp; -- cgit v1.2.3