mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Do not use a local dependent mb->wc conversion
This commit is contained in:
parent
1bc9ce513d
commit
f397686804
@ -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…
x
Reference in New Issue
Block a user