comparison common-algo.c @ 1122:aaf576b27a10

Merge pull request #13 from gazoo74/fix-warnings Fix warnings
author Matt Johnston <matt@ucc.asn.au>
date Thu, 04 Jun 2015 23:08:50 +0800
parents 1e486f368ec3 2052b53d3034
children 6aeadee3f16b
comparison
equal deleted inserted replaced
1087:1e486f368ec3 1122:aaf576b27a10
323 if (localalgos[i].usable) { 323 if (localalgos[i].usable) {
324 if (donefirst) 324 if (donefirst)
325 buf_putbyte(algolist, ','); 325 buf_putbyte(algolist, ',');
326 donefirst = 1; 326 donefirst = 1;
327 len = strlen(localalgos[i].name); 327 len = strlen(localalgos[i].name);
328 buf_putbytes(algolist, localalgos[i].name, len); 328 buf_putbytes(algolist, (const unsigned char *) localalgos[i].name, len);
329 } 329 }
330 } 330 }
331 buf_putstring(buf, algolist->data, algolist->len); 331 buf_putstring(buf, (const char*)algolist->data, algolist->len);
332 buf_free(algolist); 332 buf_free(algolist);
333 } 333 }
334 334
335 /* match the first algorithm in the comma-separated list in buf which is 335 /* match the first algorithm in the comma-separated list in buf which is
336 * also in localalgos[], or return NULL on failure. 336 * also in localalgos[], or return NULL on failure.
339 * guessed correctly */ 339 * guessed correctly */
340 algo_type * buf_match_algo(buffer* buf, algo_type localalgos[], 340 algo_type * buf_match_algo(buffer* buf, algo_type localalgos[],
341 enum kexguess2_used *kexguess2, int *goodguess) 341 enum kexguess2_used *kexguess2, int *goodguess)
342 { 342 {
343 343
344 unsigned char * algolist = NULL; 344 char * algolist = NULL;
345 const unsigned char *remotenames[MAX_PROPOSED_ALGO], *localnames[MAX_PROPOSED_ALGO]; 345 const char *remotenames[MAX_PROPOSED_ALGO], *localnames[MAX_PROPOSED_ALGO];
346 unsigned int len; 346 unsigned int len;
347 unsigned int remotecount, localcount, clicount, servcount, i, j; 347 unsigned int remotecount, localcount, clicount, servcount, i, j;
348 algo_type * ret = NULL; 348 algo_type * ret = NULL;
349 const unsigned char **clinames, **servnames; 349 const char **clinames, **servnames;
350 350
351 if (goodguess) { 351 if (goodguess) {
352 *goodguess = 0; 352 *goodguess = 0;
353 } 353 }
354 354
489 buffer *b = buf_new(200); 489 buffer *b = buf_new(200);
490 buf_put_algolist(b, algos); 490 buf_put_algolist(b, algos);
491 buf_setpos(b, b->len); 491 buf_setpos(b, b->len);
492 buf_putbyte(b, '\0'); 492 buf_putbyte(b, '\0');
493 buf_setpos(b, 4); 493 buf_setpos(b, 4);
494 ret_list = m_strdup(buf_getptr(b, b->len - b->pos)); 494 ret_list = m_strdup((const char *) buf_getptr(b, b->len - b->pos));
495 buf_free(b); 495 buf_free(b);
496 return ret_list; 496 return ret_list;
497 } 497 }
498 498
499 static algo_type* 499 static algo_type*