From 224b16b2470ab764e854eb4a7cdd568353655afc Mon Sep 17 00:00:00 2001 From: Gaël PORTAY Date: Sat, 2 May 2015 15:59:06 +0200 Subject: Fix pointer differ in signess warnings [-Werror=pointer-sign] --- common-algo.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'common-algo.c') diff --git a/common-algo.c b/common-algo.c index a3e9d78..0886a2b 100644 --- a/common-algo.c +++ b/common-algo.c @@ -338,19 +338,19 @@ algo_type * buf_match_algo(buffer* buf, algo_type localalgos[], enum kexguess2_used *kexguess2, int *goodguess) { - unsigned char * algolist = NULL; - const unsigned char *remotenames[MAX_PROPOSED_ALGO], *localnames[MAX_PROPOSED_ALGO]; + char * algolist = NULL; + const char *remotenames[MAX_PROPOSED_ALGO], *localnames[MAX_PROPOSED_ALGO]; unsigned int len; unsigned int remotecount, localcount, clicount, servcount, i, j; algo_type * ret = NULL; - const unsigned char **clinames, **servnames; + const char **clinames, **servnames; if (goodguess) { *goodguess = 0; } /* get the comma-separated list from the buffer ie "algo1,algo2,algo3" */ - algolist = buf_getstring(buf, &len); + algolist = (char *) buf_getstring(buf, &len); TRACE(("buf_match_algo: %s", algolist)) if (len > MAX_PROPOSED_ALGO*(MAX_NAME_LEN+1)) { goto out; @@ -488,7 +488,7 @@ algolist_string(algo_type algos[]) buf_setpos(b, b->len); buf_putbyte(b, '\0'); buf_setpos(b, 4); - ret_list = m_strdup(buf_getptr(b, b->len - b->pos)); + ret_list = m_strdup((const char *) buf_getptr(b, b->len - b->pos)); buf_free(b); return ret_list; } -- cgit v1.2.3 From 6b90885d4f8699e8607481422a43ec72fa84f295 Mon Sep 17 00:00:00 2001 From: Gaël PORTAY Date: Sat, 2 May 2015 22:37:08 +0200 Subject: Turn Algo_Type's name attribute into const char * --- algo.h | 2 +- common-algo.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'common-algo.c') diff --git a/algo.h b/algo.h index 5b7b874..49c4f41 100644 --- a/algo.h +++ b/algo.h @@ -35,7 +35,7 @@ struct Algo_Type { - const unsigned char *name; /* identifying name */ + const char *name; /* identifying name */ char val; /* a value for this cipher, or -1 for invalid */ const void *data; /* algorithm specific data */ char usable; /* whether we can use this algorithm */ diff --git a/common-algo.c b/common-algo.c index 0886a2b..76d3977 100644 --- a/common-algo.c +++ b/common-algo.c @@ -322,7 +322,7 @@ void buf_put_algolist(buffer * buf, algo_type localalgos[]) { buf_putbyte(algolist, ','); donefirst = 1; len = strlen(localalgos[i].name); - buf_putbytes(algolist, localalgos[i].name, len); + buf_putbytes(algolist, (const unsigned char *) localalgos[i].name, len); } } buf_putstring(buf, algolist->data, algolist->len); -- cgit v1.2.3