GUAC-598: Fix warnings against SSH.

This commit is contained in:
Michael Jumper 2014-04-11 13:45:19 -07:00
parent 5f84cbc5e4
commit 3823165d7f
4 changed files with 24 additions and 23 deletions

View File

@ -34,6 +34,7 @@
#include <pthread.h> #include <pthread.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <sys/select.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
@ -129,15 +130,17 @@ static int __sign_callback(LIBSSH2_SESSION* session,
const unsigned char* data, size_t data_len, void **abstract) { const unsigned char* data, size_t data_len, void **abstract) {
ssh_key* key = (ssh_key*) abstract; ssh_key* key = (ssh_key*) abstract;
int length;
/* Allocate space for signature */ /* Allocate space for signature */
*sig = malloc(4096); *sig = malloc(4096);
/* Sign with key */ /* Sign with key */
*sig_len = ssh_key_sign(key, (const char*) data, data_len, *sig); length = ssh_key_sign(key, (const char*) data, data_len, *sig);
if (*sig_len < 0) if (length < 0)
return 1; return 1;
*sig_len = length;
return 0; return 0;
} }

View File

@ -52,7 +52,7 @@ typedef struct guac_terminal guac_terminal;
* the current char handler for the terminal is called and given that * the current char handler for the terminal is called and given that
* character. * character.
*/ */
typedef int guac_terminal_char_handler(guac_terminal* term, char c); typedef int guac_terminal_char_handler(guac_terminal* term, unsigned char c);
/** /**
* Represents a terminal emulator which uses a given Guacamole client to * Represents a terminal emulator which uses a given Guacamole client to

View File

@ -45,7 +45,7 @@
*/ */
#define GUAC_TERMINAL_OK "\x1B[0n" #define GUAC_TERMINAL_OK "\x1B[0n"
int guac_terminal_echo(guac_terminal* term, char c) { int guac_terminal_echo(guac_terminal* term, unsigned char c) {
static int bytes_remaining = 0; static int bytes_remaining = 0;
static int codepoint = 0; static int codepoint = 0;
@ -216,7 +216,7 @@ int guac_terminal_echo(guac_terminal* term, char c) {
} }
int guac_terminal_escape(guac_terminal* term, char c) { int guac_terminal_escape(guac_terminal* term, unsigned char c) {
switch (c) { switch (c) {
@ -360,7 +360,7 @@ static const int* __guac_terminal_get_char_mapping(char c) {
} }
int guac_terminal_g0_charset(guac_terminal* term, char c) { int guac_terminal_g0_charset(guac_terminal* term, unsigned char c) {
term->char_mapping[0] = __guac_terminal_get_char_mapping(c); term->char_mapping[0] = __guac_terminal_get_char_mapping(c);
term->char_handler = guac_terminal_echo; term->char_handler = guac_terminal_echo;
@ -368,7 +368,7 @@ int guac_terminal_g0_charset(guac_terminal* term, char c) {
} }
int guac_terminal_g1_charset(guac_terminal* term, char c) { int guac_terminal_g1_charset(guac_terminal* term, unsigned char c) {
term->char_mapping[1] = __guac_terminal_get_char_mapping(c); term->char_mapping[1] = __guac_terminal_get_char_mapping(c);
term->char_handler = guac_terminal_echo; term->char_handler = guac_terminal_echo;
@ -400,7 +400,7 @@ static bool* __guac_terminal_get_flag(guac_terminal* term, int num, char private
} }
int guac_terminal_csi(guac_terminal* term, char c) { int guac_terminal_csi(guac_terminal* term, unsigned char c) {
/* CSI function arguments */ /* CSI function arguments */
static int argc = 0; static int argc = 0;
@ -876,7 +876,7 @@ int guac_terminal_csi(guac_terminal* term, char c) {
} }
int guac_terminal_guac_set_directory(guac_terminal* term, char c) { int guac_terminal_guac_set_directory(guac_terminal* term, unsigned char c) {
static char filename[2048]; static char filename[2048];
static int length = 0; static int length = 0;
@ -897,7 +897,7 @@ int guac_terminal_guac_set_directory(guac_terminal* term, char c) {
} }
int guac_terminal_guac_download(guac_terminal* term, char c) { int guac_terminal_guac_download(guac_terminal* term, unsigned char c) {
static char filename[2048]; static char filename[2048];
static int length = 0; static int length = 0;
@ -918,7 +918,7 @@ int guac_terminal_guac_download(guac_terminal* term, char c) {
} }
int guac_terminal_osc(guac_terminal* term, char c) { int guac_terminal_osc(guac_terminal* term, unsigned char c) {
static int operation = 0; static int operation = 0;
@ -949,7 +949,7 @@ int guac_terminal_osc(guac_terminal* term, char c) {
return 0; return 0;
} }
int guac_terminal_ctrl_func(guac_terminal* term, char c) { int guac_terminal_ctrl_func(guac_terminal* term, unsigned char c) {
int row; int row;

View File

@ -28,17 +28,15 @@
#include "terminal.h" #include "terminal.h"
int guac_terminal_echo(guac_terminal* term, char c); int guac_terminal_echo(guac_terminal* term, unsigned char c);
int guac_terminal_escape(guac_terminal* term, char c); int guac_terminal_escape(guac_terminal* term, unsigned char c);
int guac_terminal_g0_charset(guac_terminal* term, char c); int guac_terminal_g0_charset(guac_terminal* term, unsigned char c);
int guac_terminal_g1_charset(guac_terminal* term, char c); int guac_terminal_g1_charset(guac_terminal* term, unsigned char c);
int guac_terminal_g2_charset(guac_terminal* term, char c); int guac_terminal_csi(guac_terminal* term, unsigned char c);
int guac_terminal_g3_charset(guac_terminal* term, char c); int guac_terminal_guac_download(guac_terminal* term, unsigned char c);
int guac_terminal_csi(guac_terminal* term, char c); int guac_terminal_guac_set_directory(guac_terminal* term, unsigned char c);
int guac_terminal_guac_download(guac_terminal* term, char c); int guac_terminal_osc(guac_terminal* term, unsigned char c);
int guac_terminal_guac_set_directory(guac_terminal* term, char c); int guac_terminal_ctrl_func(guac_terminal* term, unsigned char c);
int guac_terminal_osc(guac_terminal* term, char c);
int guac_terminal_ctrl_func(guac_terminal* term, char c);
#endif #endif