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) {
|
int write_to_terminal(TERMINAL_CHAR_TYPE ch) {
|
||||||
write(current_terminal, &ch, 1);
|
write(current_terminal, &ch, 1);
|
||||||
|
return ch;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* getcap(const char* capability) {
|
const char* getcap(const char* capability) {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ char* java_to_char(JNIEnv *env, jstring string, jobject result) {
|
|||||||
env->ReleaseStringChars(string, javaString);
|
env->ReleaseStringChars(string, javaString);
|
||||||
|
|
||||||
size_t bytes = wcstombs(NULL, wideString, 0);
|
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);
|
mark_failed_with_message(env, "could not convert string to current locale", result);
|
||||||
free(wideString);
|
free(wideString);
|
||||||
return NULL;
|
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) {
|
jstring char_to_java(JNIEnv* env, const char* chars, jobject result) {
|
||||||
size_t bytes = strlen(chars);
|
size_t bytes = strlen(chars);
|
||||||
wchar_t* wideString = (wchar_t*)malloc(sizeof(wchar_t) * (bytes+1));
|
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);
|
mark_failed_with_message(env, "could not convert string from current locale", result);
|
||||||
free(wideString);
|
free(wideString);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user