diff options
author | Charles Wilson <cygwin@cwilson.fastmail.fm> | 2009-10-26 17:50:09 +0300 |
---|---|---|
committer | Charles Wilson <cygwin@cwilson.fastmail.fm> | 2009-10-26 17:50:09 +0300 |
commit | 73ddc920626f1e2ad52db21ba81c5a99f329b73c (patch) | |
tree | 21890d4aea751d1dd20e2011d1e4da5d5dd413a1 /winsup | |
parent | 654d34dda556d5d3ac27f08322fefa5ea3d6cdad (diff) |
Correct pseudo-reloc size bug wrt error messages
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/lib/pseudo-reloc.c | 5 | ||||
-rw-r--r-- | winsup/cygwin/pseudo-reloc.cc | 5 |
3 files changed, 11 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 12209939a..8141ab754 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2009-10-26 Charles Wilson <cygwin@cwilson.fastmail.fm> + + * lib/pseudo-reloc.c (__report_error) [CYGWIN]: Correct size bug + regarding error messages. + 2009-10-25 Charles Wilson <cygwin@cwilson.fastmail.fm> Sync pseudo-reloc.c with mingw64 diff --git a/winsup/cygwin/lib/pseudo-reloc.c b/winsup/cygwin/lib/pseudo-reloc.c index 736f5318d..77f041114 100644 --- a/winsup/cygwin/lib/pseudo-reloc.c +++ b/winsup/cygwin/lib/pseudo-reloc.c @@ -93,7 +93,8 @@ __report_error (const char *msg, ...) char buf[SHORT_MSG_BUF_SZ]; wchar_t module[MAX_PATH]; char * posix_module = NULL; - static const char * UNKNOWN_MODULE = "<unknown module>: "; + static const char UNKNOWN_MODULE[] = "<unknown module>: "; + static const size_t UNKNOWN_MODULE_LEN = sizeof (UNKNOWN_MODULE) - 1; static const char CYGWIN_FAILURE_MSG[] = "Cygwin runtime failure: "; static const size_t CYGWIN_FAILURE_MSG_LEN = sizeof (CYGWIN_FAILURE_MSG) - 1; DWORD len; @@ -130,7 +131,7 @@ __report_error (const char *msg, ...) WriteFile (errh, (PCVOID)CYGWIN_FAILURE_MSG, CYGWIN_FAILURE_MSG_LEN, &done, NULL); WriteFile (errh, (PCVOID)UNKNOWN_MODULE, - sizeof(UNKNOWN_MODULE), &done, NULL); + UNKNOWN_MODULE_LEN, &done, NULL); WriteFile (errh, (PCVOID)buf, len, &done, NULL); } WriteFile (errh, (PCVOID)"\n", 1, &done, NULL); diff --git a/winsup/cygwin/pseudo-reloc.cc b/winsup/cygwin/pseudo-reloc.cc index 736f5318d..77f041114 100644 --- a/winsup/cygwin/pseudo-reloc.cc +++ b/winsup/cygwin/pseudo-reloc.cc @@ -93,7 +93,8 @@ __report_error (const char *msg, ...) char buf[SHORT_MSG_BUF_SZ]; wchar_t module[MAX_PATH]; char * posix_module = NULL; - static const char * UNKNOWN_MODULE = "<unknown module>: "; + static const char UNKNOWN_MODULE[] = "<unknown module>: "; + static const size_t UNKNOWN_MODULE_LEN = sizeof (UNKNOWN_MODULE) - 1; static const char CYGWIN_FAILURE_MSG[] = "Cygwin runtime failure: "; static const size_t CYGWIN_FAILURE_MSG_LEN = sizeof (CYGWIN_FAILURE_MSG) - 1; DWORD len; @@ -130,7 +131,7 @@ __report_error (const char *msg, ...) WriteFile (errh, (PCVOID)CYGWIN_FAILURE_MSG, CYGWIN_FAILURE_MSG_LEN, &done, NULL); WriteFile (errh, (PCVOID)UNKNOWN_MODULE, - sizeof(UNKNOWN_MODULE), &done, NULL); + UNKNOWN_MODULE_LEN, &done, NULL); WriteFile (errh, (PCVOID)buf, len, &done, NULL); } WriteFile (errh, (PCVOID)"\n", 1, &done, NULL); |