Correct pseudo-reloc size bug wrt error messages

This commit is contained in:
Charles Wilson 2009-10-26 14:50:09 +00:00
parent 654d34dda5
commit 73ddc92062
3 changed files with 11 additions and 4 deletions

View File

@ -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

View File

@ -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);

View File

@ -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);