mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 18:33:50 +02:00
Do not use a local dependent mb->wc conversion
This commit is contained in:
parent
1bc9ce513d
commit
f397686804
1 changed files with 2 additions and 2 deletions
|
|
@ -534,8 +534,8 @@ winutil_eject_drive(PyObject *self, PyObject *args) {
|
|||
|
||||
if (!PyArg_ParseTuple(args, "c", &letter)) return NULL;
|
||||
|
||||
if (mbtowc(&DriveLetter, &letter, 1) == -1) {
|
||||
PyErr_SetString(PyExc_ValueError, "Failed to convert drive letter to wchar");
|
||||
if (MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, &letter, 1, &DriveLetter, 1) == 0) {
|
||||
PyErr_SetFromWindowsErr(0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue