Fixed a couple of compiler warnings.
This commit is contained in:
@@ -47,6 +47,7 @@ const char* terminal_capabilities[9];
|
||||
|
||||
int write_to_terminal(TERMINAL_CHAR_TYPE ch) {
|
||||
write(current_terminal, &ch, 1);
|
||||
return ch;
|
||||
}
|
||||
|
||||
const char* getcap(const char* capability) {
|
||||
|
||||
@@ -48,7 +48,7 @@ char* java_to_char(JNIEnv *env, jstring string, jobject result) {
|
||||
env->ReleaseStringChars(string, javaString);
|
||||
|
||||
size_t bytes = wcstombs(NULL, wideString, 0);
|
||||
if (bytes < 0) {
|
||||
if (bytes == (size_t)-1) {
|
||||
mark_failed_with_message(env, "could not convert string to current locale", result);
|
||||
free(wideString);
|
||||
return NULL;
|
||||
@@ -64,7 +64,7 @@ char* java_to_char(JNIEnv *env, jstring string, jobject result) {
|
||||
jstring char_to_java(JNIEnv* env, const char* chars, jobject result) {
|
||||
size_t bytes = strlen(chars);
|
||||
wchar_t* wideString = (wchar_t*)malloc(sizeof(wchar_t) * (bytes+1));
|
||||
if (mbstowcs(wideString, chars, bytes+1) < 0) {
|
||||
if (mbstowcs(wideString, chars, bytes+1) == (size_t)-1) {
|
||||
mark_failed_with_message(env, "could not convert string from current locale", result);
|
||||
free(wideString);
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user