comparison src/proxy.c @ 9653:5332ebbf437b

[gaim-migrate @ 10501] " Regarding that bug, I simply wrapped the the assignment of hostname to dns_params.hostname with g_strstrip(). This allows a lookup by name of a host that had whitespace after the server hostname (also works if there is whitespace before the hostname now)" -- jlapenna committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 03 Aug 2004 23:27:18 +0000
parents 9171e528d7e5
children 00f96f4cc775
comparison
equal deleted inserted replaced
9652:1ea8b1dc2b5a 9653:5332ebbf437b
419 419
420 int gaim_gethostbyname_async(const char *hostname, int port, dns_callback_t callback, gpointer data) 420 int gaim_gethostbyname_async(const char *hostname, int port, dns_callback_t callback, gpointer data)
421 { 421 {
422 pending_dns_request_t *req = NULL; 422 pending_dns_request_t *req = NULL;
423 dns_params_t dns_params; 423 dns_params_t dns_params;
424 424
425 strncpy(dns_params.hostname, hostname, sizeof(dns_params.hostname)-1); 425 char *host_temp = g_strdup(hostname);
426 strncpy(dns_params.hostname, g_strstrip(host_temp), sizeof(dns_params.hostname)-1);
427 g_free(host_temp);
426 dns_params.hostname[sizeof(dns_params.hostname)-1] = '\0'; 428 dns_params.hostname[sizeof(dns_params.hostname)-1] = '\0';
427 dns_params.port = port; 429 dns_params.port = port;
428 430
429 /* Is there a free available child? */ 431 /* Is there a free available child? */
430 while(free_dns_children && !req) { 432 while(free_dns_children && !req) {