fix type warnings
This commit is contained in:
parent
efa1c4a4ff
commit
087bf06cac
@ -15,20 +15,20 @@ ssize_t getline (char **lptr, size_t *n, FILE *fp) {
|
|||||||
HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE);
|
HANDLE hIn = GetStdHandle(STD_INPUT_HANDLE);
|
||||||
|
|
||||||
if (!ReadConsoleW(hIn, &buf, chars, &read_chars, NULL)) {
|
if (!ReadConsoleW(hIn, &buf, chars, &read_chars, NULL)) {
|
||||||
fprintf(stderr, "Failed to read console input: %d", GetLastError());
|
fprintf(stderr, "Failed to read console input: %d", (int)GetLastError());
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
convertResult = WideCharToMultiByte(CP_UTF8, 0, buf, -1, NULL, 0, NULL, NULL);
|
convertResult = WideCharToMultiByte(CP_UTF8, 0, buf, -1, NULL, 0, NULL, NULL);
|
||||||
if (convertResult == 0) {
|
if (convertResult == 0) {
|
||||||
fprintf(stderr, "Failed to get MultiByte length: %d", GetLastError());
|
fprintf(stderr, "Failed to get MultiByte length: %d", (int)GetLastError());
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
m = *lptr = (char*) calloc(convertResult, sizeof(char));
|
m = *lptr = (char*) calloc(convertResult, sizeof(char));
|
||||||
|
|
||||||
if (WideCharToMultiByte(CP_UTF8, 0, buf, -1, m, convertResult, NULL, NULL) == 0 ) {
|
if (WideCharToMultiByte(CP_UTF8, 0, buf, -1, m, convertResult, NULL, NULL) == 0 ) {
|
||||||
fprintf(stderr, "Failed to convert wide characters: %d", GetLastError());
|
fprintf(stderr, "Failed to convert wide characters: %d", (int)GetLastError());
|
||||||
free(m);
|
free(m);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user