Avoid compiler warnings.

This commit is contained in:
oliverschmidt 2007-04-13 22:02:28 +00:00
parent 766878f5c9
commit 079a4a1b54
2 changed files with 6 additions and 6 deletions

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki desktop OS. * This file is part of the Contiki desktop OS.
* *
* $Id: telnetd-gui.c,v 1.1 2006/06/17 22:41:13 adamdunkels Exp $ * $Id: telnetd-gui.c,v 1.2 2007/04/13 22:02:28 oliverschmidt Exp $
* *
*/ */
@ -63,7 +63,7 @@ telnetd_gui_output(char *str1, char *str2)
} }
memset(&log[(YSIZE - 1) * XSIZE], 0, XSIZE); memset(&log[(YSIZE - 1) * XSIZE], 0, XSIZE);
len = strlen(str1); len = (unsigned int)strlen(str1);
strncpy(&log[(YSIZE - 1) * XSIZE], str1, XSIZE); strncpy(&log[(YSIZE - 1) * XSIZE], str1, XSIZE);
if(len < XSIZE) { if(len < XSIZE) {

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki desktop OS. * This file is part of the Contiki desktop OS.
* *
* $Id: telnetd.c,v 1.2 2007/04/13 21:04:52 oliverschmidt Exp $ * $Id: telnetd.c,v 1.3 2007/04/13 22:02:28 oliverschmidt Exp $
* *
*/ */
@ -149,12 +149,12 @@ shell_output(char *str1, char *str2)
line = alloc_line(); line = alloc_line();
if(line != NULL) { if(line != NULL) {
len = strlen(str1); len = (unsigned int)strlen(str1);
strncpy(line, str1, TELNETD_CONF_LINELEN); strncpy(line, str1, TELNETD_CONF_LINELEN);
if(len < TELNETD_CONF_LINELEN) { if(len < TELNETD_CONF_LINELEN) {
strncpy(line + len, str2, TELNETD_CONF_LINELEN - len); strncpy(line + len, str2, TELNETD_CONF_LINELEN - len);
} }
len = strlen(line); len = (unsigned int)strlen(line);
if(len < TELNETD_CONF_LINELEN - 2) { if(len < TELNETD_CONF_LINELEN - 2) {
line[len] = ISO_cr; line[len] = ISO_cr;
line[len+1] = ISO_nl; line[len+1] = ISO_nl;
@ -215,7 +215,7 @@ senddata(void)
for(s.numsent = 0; s.numsent < TELNETD_CONF_NUMLINES && for(s.numsent = 0; s.numsent < TELNETD_CONF_NUMLINES &&
s.lines[s.numsent] != NULL ; ++s.numsent) { s.lines[s.numsent] != NULL ; ++s.numsent) {
lineptr = s.lines[s.numsent]; lineptr = s.lines[s.numsent];
linelen = strlen(lineptr); linelen = (int)strlen(lineptr);
if(linelen > TELNETD_CONF_LINELEN) { if(linelen > TELNETD_CONF_LINELEN) {
linelen = TELNETD_CONF_LINELEN; linelen = TELNETD_CONF_LINELEN;
} }