comparison common-algo.c @ 1094:c45d65392c1a

Fix pointer differ in signess warnings [-Werror=pointer-sign]
author Gaël PORTAY <gael.portay@gmail.com>
date Sat, 02 May 2015 15:59:06 +0200
parents d3925ed45a85
children 2052b53d3034
comparison
equal deleted inserted replaced
1093:aae71c5f7d5b 1094:c45d65392c1a
336 * guessed correctly */ 336 * guessed correctly */
337 algo_type * buf_match_algo(buffer* buf, algo_type localalgos[], 337 algo_type * buf_match_algo(buffer* buf, algo_type localalgos[],
338 enum kexguess2_used *kexguess2, int *goodguess) 338 enum kexguess2_used *kexguess2, int *goodguess)
339 { 339 {
340 340
341 unsigned char * algolist = NULL; 341 char * algolist = NULL;
342 const unsigned char *remotenames[MAX_PROPOSED_ALGO], *localnames[MAX_PROPOSED_ALGO]; 342 const char *remotenames[MAX_PROPOSED_ALGO], *localnames[MAX_PROPOSED_ALGO];
343 unsigned int len; 343 unsigned int len;
344 unsigned int remotecount, localcount, clicount, servcount, i, j; 344 unsigned int remotecount, localcount, clicount, servcount, i, j;
345 algo_type * ret = NULL; 345 algo_type * ret = NULL;
346 const unsigned char **clinames, **servnames; 346 const char **clinames, **servnames;
347 347
348 if (goodguess) { 348 if (goodguess) {
349 *goodguess = 0; 349 *goodguess = 0;
350 } 350 }
351 351
352 /* get the comma-separated list from the buffer ie "algo1,algo2,algo3" */ 352 /* get the comma-separated list from the buffer ie "algo1,algo2,algo3" */
353 algolist = buf_getstring(buf, &len); 353 algolist = (char *) buf_getstring(buf, &len);
354 TRACE(("buf_match_algo: %s", algolist)) 354 TRACE(("buf_match_algo: %s", algolist))
355 if (len > MAX_PROPOSED_ALGO*(MAX_NAME_LEN+1)) { 355 if (len > MAX_PROPOSED_ALGO*(MAX_NAME_LEN+1)) {
356 goto out; 356 goto out;
357 } 357 }
358 358
486 buffer *b = buf_new(200); 486 buffer *b = buf_new(200);
487 buf_put_algolist(b, algos); 487 buf_put_algolist(b, algos);
488 buf_setpos(b, b->len); 488 buf_setpos(b, b->len);
489 buf_putbyte(b, '\0'); 489 buf_putbyte(b, '\0');
490 buf_setpos(b, 4); 490 buf_setpos(b, 4);
491 ret_list = m_strdup(buf_getptr(b, b->len - b->pos)); 491 ret_list = m_strdup((const char *) buf_getptr(b, b->len - b->pos));
492 buf_free(b); 492 buf_free(b);
493 return ret_list; 493 return ret_list;
494 } 494 }
495 495
496 static algo_type* 496 static algo_type*