Commit 1b51530a authored by runge's avatar runge

x11vnc: remove compiler warnings; HP-UX tweaks.

parent a7726a6f
......@@ -445,6 +445,13 @@ AC_FUNC_VPRINTF
AC_FUNC_FORK
AC_CHECK_LIB(nsl,gethostbyname)
AC_CHECK_LIB(socket,socket)
uname_s=`(uname -s) 2>/dev/null`
if test "x$uname_s" = "xHP-UX"; then
# need -lsec for getspnam()
LDFLAGS="$LDFLAGS -lsec"
fi
AC_CHECK_FUNCS([ftime gethostbyname gethostname gettimeofday inet_ntoa memmove memset mmap mkfifo select socket strchr strcspn strdup strerror strstr setsid setpgrp getpwuid getpwnam getspnam getuid geteuid setuid setgid seteuid setegid waitpid setutxent grantpt])
# check, if shmget is in cygipc.a
......
x11vnc README file Date: Tue Jul 4 12:02:55 EDT 2006
x11vnc README file Date: Tue Jul 4 14:26:15 EDT 2006
The following information is taken from these URLs:
......
......@@ -97,7 +97,7 @@ char *ip2host(char *ip) {
int dotted_ip(char *host) {
char *p = host;
while (*p != '\0') {
if (*p == '.' || isdigit(*p)) {
if (*p == '.' || isdigit((unsigned char) (*p))) {
p++;
continue;
}
......
......@@ -579,7 +579,7 @@ static void add_dead_keysyms(char *str) {
p = str;
while (*p != '\0') {
if (isspace(*p)) {
if (isspace((unsigned char) (*p))) {
*p = '\0';
}
p++;
......
......@@ -1170,7 +1170,11 @@ static void csock_timeout (int sig) {
static int wait_conn(int sock) {
int conn;
struct sockaddr_in addr;
#ifdef __hpux
int addrlen = sizeof(addr);
#else
socklen_t addrlen = sizeof(addr);
#endif
signal(SIGALRM, csock_timeout);
csock_timeout_sock = sock;
......@@ -1262,7 +1266,11 @@ void accept_openssl(int mode) {
int sock = -1, listen = -1, cport, csock, vsock;
int status, n, i, db = 0;
struct sockaddr_in addr;
#ifdef __hpux
int addrlen = sizeof(addr);
#else
socklen_t addrlen = sizeof(addr);
#endif
rfbClientPtr client;
pid_t pid;
char uniq[] = "__evilrats__";
......
......@@ -358,7 +358,7 @@ int crypt_verify(char *user, char *pass) {
if (db > 1) fprintf(stderr, "realpw='%s'\n", realpw);
if (strlen(realpw) < 10) {
if (strlen(realpw) < 12) {
/* e.g. "x", try getspnam(), sometimes root for inetd, etc */
#if LIBVNCSERVER_HAVE_GETSPNAM
struct spwd *sp = getspnam(user);
......@@ -680,11 +680,11 @@ if (db) fprintf(stderr, "%s", buf);
}
if (n == 1) {
if (isspace(buf[0])) {
if (isspace((unsigned char) buf[0])) {
i--;
continue;
}
instr[j++] = tolower(buf[0]);
instr[j++] = tolower((unsigned char)buf[0]);
}
if (n <= 0 || strstr(pstr, instr) != pstr) {
if (db) {
......
......@@ -244,7 +244,7 @@ static void user2uid(char *user, uid_t *uid, char **name, char **home) {
q = user;
while (*q) {
if (! isdigit(*q++)) {
if (! isdigit((unsigned char) (*q++))) {
numerical = 0;
break;
}
......@@ -810,7 +810,7 @@ int read_passwds(char *passfile) {
}
p = line;
while (*p != '\0') {
if (! isspace(*p)) {
if (! isspace((unsigned char) (*p))) {
blank = 0;
break;
}
......
......@@ -103,7 +103,7 @@ void lowercase(char *str) {
}
p = str;
while (*p != '\0') {
*p = tolower(*p);
*p = tolower((unsigned char) (*p));
p++;
}
}
......@@ -115,7 +115,7 @@ void uppercase(char *str) {
}
p = str;
while (*p != '\0') {
*p = toupper(*p);
*p = toupper((unsigned char) (*p));
p++;
}
}
......@@ -123,7 +123,7 @@ void uppercase(char *str) {
char *lblanks(char *str) {
char *p = str;
while (*p != '\0') {
if (! isspace(*p)) {
if (! isspace((unsigned char) (*p))) {
break;
}
p++;
......
......@@ -1471,7 +1471,7 @@ static void init_freqtab(char *file) {
if (*q == ']') {
break;
}
if (! isdigit(*q)) {
if (! isdigit((unsigned char) (*q))) {
if (0) fprintf(stderr, "extra: %s\n", p);
extra++;
ok = 0;
......@@ -1508,7 +1508,7 @@ static void init_freqtab(char *file) {
if (*q == ']') {
break;
}
if (! isdigit(*q)) {
if (! isdigit((unsigned char) (*q))) {
extra++;
currn = maxn + extra;
ok = 0;
......
......@@ -754,7 +754,7 @@ static void check_rcfile(int argc, char **argv) {
*(q-1) = ' ';
break;
}
while (isspace(*q)) {
while (isspace((unsigned char) (*q))) {
*q = '\0';
if (q == p) {
break;
......@@ -770,7 +770,7 @@ static void check_rcfile(int argc, char **argv) {
if (*q == '\0') {
q--;
}
while (isspace(*q)) {
while (isspace((unsigned char) (*q))) {
*q = '\0';
if (q == p) {
break;
......@@ -793,7 +793,7 @@ static void check_rcfile(int argc, char **argv) {
q = buf;
while (*q) {
i++;
if (*q == '\n' || isspace(*q)) {
if (*q == '\n' || isspace((unsigned char) (*q))) {
break;
}
q++;
......@@ -1916,7 +1916,7 @@ int main(int argc, char* argv[]) {
if (*s == '-') {
s++;
}
if (isdigit(*s)) {
if (isdigit((unsigned char) (*s))) {
no_repeat_countdown = atoi(argv[++i]);
}
}
......
......@@ -19,6 +19,10 @@
#include <unistd.h>
#include <signal.h>
#include <sys/utsname.h>
#ifdef __hpux
/* to avoid select() compiler warning */
#include <sys/time.h>
#endif
#include <time.h>
#include <errno.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment