Fix warnings trivial warnings.

Fix warnings about:
 . Unused variables
 . format mismatch in printf/scanf format string and arguments
 . Missing parenthesis around assignment as truth values
 . Clang warnings anout unknown GCC pragma
This commit is contained in:
2013-01-14 11:44:31 +01:00
parent 77399bd649
commit 0ac803292e
65 changed files with 297 additions and 284 deletions
+3 -1
View File
@@ -37,7 +37,9 @@
#include <net/gen/inet.h>
#include "telnetd.h"
#if 0
static char *Version = "@(#) telnetd 1.00 (07/26/92)";
#endif
int opt_d = 0; /* debugging output flag */
@@ -105,7 +107,7 @@ char *hostname;
lineno = 0;
for (;;) {
if ((ttyp = getttyent()) == NULL) {
sprintf(buff, "Can't find %s in the tty table\r\n");
sprintf(buff, "Can't find the tty entry in the tty table\r\n");
(void) write(1, buff, strlen(buff));
}
if (strcmp(ttyp->ty_name, tty_name+5) == 0) break;
+3 -3
View File
@@ -96,7 +96,7 @@ int len;
(void) write(fdout, buf, len);
}
int set_winsize(int fd, unsigned int cols, unsigned int rows)
void set_winsize(int fd, unsigned int cols, unsigned int rows)
{
struct winsize w;
memset(&w, 0, sizeof(w));
@@ -105,7 +105,7 @@ int set_winsize(int fd, unsigned int cols, unsigned int rows)
ioctl(fd, TIOCSWINSZ, (char *) &w);
}
int tel_in(fdout, telout, buffer, len)
void tel_in(fdout, telout, buffer, len)
int fdout;
int telout;
char *buffer;
@@ -227,7 +227,7 @@ int c;
write(fdout, buffer, size);
}
int tel_out(fdout, buf, size)
void tel_out(fdout, buf, size)
int fdout;
char *buf;
int size;
+2 -2
View File
@@ -16,5 +16,5 @@ void term_init(void);
void term_inout(int pty_fd);
void tel_init(void);
void telopt(int fdout, int what, int option);
int tel_in(int fdout, int telout, char *buffer, int len);
int tel_out(int fdout, char *buf, int size);
void tel_in(int fdout, int telout, char *buffer, int len);
void tel_out(int fdout, char *buf, int size);
+1 -1
View File
@@ -107,6 +107,6 @@ char *label;
{
char message[128];
sprintf(message, "telnetd: %s: %s\r\n", strerror(errno));
sprintf(message, "telnetd: %i: %s\r\n", errno, strerror(errno));
(void) write(1, message, strlen(message));
}