Mercurial > hg
changeset 27:77e6bd2ccde6
[/trunk] Changeset 43 by mikael
* Some more very small fixes, nothing serious.
author | mikael |
---|---|
date | Mon, 28 Mar 2005 09:18:01 +0000 |
parents | 8588f5a4b638 |
children | 0cd8025eebee |
files | mcabber/src/main.c mcabber/src/server.c |
diffstat | 2 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/mcabber/src/main.c Mon Mar 28 08:54:43 2005 +0000 +++ b/mcabber/src/main.c Mon Mar 28 09:18:01 2005 +0000 @@ -55,7 +55,7 @@ /* Restore terminal. */ (void) tcsetattr(fileno (stdin), TCSAFLUSH, &orig); - return nread; + return (ssize_t)nread; } void credits(void) @@ -145,7 +145,7 @@ /* Connect to server */ portstring = cfg_read("port"); - port = (portstring != NULL) ? atoi(portstring) : -1; + port = (portstring != NULL) ? (unsigned int) atoi(portstring) : -1U; ut_WriteLog("Connecting to server: %s:%d\n", servername, port); if ((sock = srv_connect(servername, port)) < 0) { @@ -179,7 +179,7 @@ ping = 15; if (cfg_read("pinginterval")) - ping = atoi(cfg_read("pinginterval")); + ping = (unsigned int) atoi(cfg_read("pinginterval")); ut_WriteLog("Ping interval stablished: %d secs\n", ping);
--- a/mcabber/src/server.c Mon Mar 28 08:54:43 2005 +0000 +++ b/mcabber/src/server.c Mon Mar 28 09:18:01 2005 +0000 @@ -50,10 +50,10 @@ */ static u_long srv_resolve(const char *host) { - long i; + in_addr_t i; struct hostent *he; - if ((i = inet_addr(host)) == -1) { + if ((i = inet_addr(host)) == INADDR_NONE) { if (!(he = gethostbyname(host))) return 0; else @@ -157,7 +157,7 @@ free(stringtosend); return NULL; } - strncpy(idsession, aux, pos); + strncpy(idsession, aux, (size_t)pos); free(response); @@ -274,7 +274,7 @@ char *utf8inputline = utf8_encode(text); sprintf(stringtosend, - "<message from='%s' to='%s' type='chat'><body>%s</body></message>", + "<message from='%s' to='%s' type='chat'><body>%.1536s</body></message>", from, to, utf8inputline); if (!sk_send(sock, stringtosend)) { perror("senddata (server.c:247)");