fix a few more warnings

This commit is contained in:
marschap
2006-04-14 08:04:09 +00:00
parent df38a63770
commit d39c092fb4
7 changed files with 179 additions and 118 deletions
+2 -2
View File
@@ -645,7 +645,7 @@ bayrad_hbar(Driver * drvthis, int x, int y, int len, int promille, int options)
MODULE_EXPORT int
bayrad_icon(Driver * drvthis, int x, int y, int icon)
{
//PrivateData *p = drvthis->private_data;
/*PrivateData *p = drvthis->private_data;
static char icons[3][5*8] = {
{
1,1,1,1,1, // Empty Heart
@@ -675,7 +675,7 @@ bayrad_icon(Driver * drvthis, int x, int y, int icon)
0,0,0,0,0,
1,0,1,0,1,
}
};
};*/
switch (icon) {
case ICON_BLOCK_FILLED:
+2 -2
View File
@@ -136,7 +136,7 @@ read_tele(PrivateData *p, char *buffer)
&& (zeichen==cc))
{
buffer[len]=0x00;
debug(RPT_DEBUG, "%s: read %s", __FUNCTION__, buffer);
/*debug(RPT_DEBUG, "%s: read %s", __FUNCTION__, buffer)*/;
return True;
}
else
@@ -204,7 +204,7 @@ real_send_tele(PrivateData *p, char *buffer, int len)
/* Take a little nap. This works as a pacemaker */
usleep(50);
debug(RPT_DEBUG, "%s: sent %s", __FUNCTION__, buffer);
/*debug(RPT_DEBUG, "%s: sent %s", __FUNCTION__, buffer);*/
return 0;
}
+9 -4
View File
@@ -128,14 +128,19 @@ handle_input ()
void input_send_to_client (Client * c, const char * key)
{
char * s;
size_t size = strlen(key) + sizeof("key %s\n"); // this is large enough
debug (RPT_DEBUG, "%s( client=[%d], key=\"%.40s\" )", __FUNCTION__, c->sock, key);
/* Allocate just as much as we need */
s = malloc (strlen(key) + strlen("key \n") + 1);
sprintf(s, "key %s\n", key);
sock_send_string(c->sock, s);
free (s);
s = calloc (1, size);
if (s != NULL) {
snprintf(s, size, "key %s\n", key);
sock_send_string(c->sock, s);
free (s);
}
else
report(RPT_ERR, "%s: malloc failure", __FUNCTION__);
}