This commit is contained in:
Yang Tse 2010-02-18 12:31:24 +00:00
Родитель 19e089702a
Коммит 6e461e45c3
4 изменённых файлов: 15 добавлений и 20 удалений

Просмотреть файл

@ -1227,15 +1227,14 @@ int main(int argc, char *argv[])
arg++;
if(argc>arg) {
char *endptr;
long lnum = -1;
lnum = strtol(argv[arg], &endptr, 10);
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
if((endptr != argv[arg] + strlen(argv[arg])) ||
(lnum < 1025L) || (lnum > 65535L)) {
(ulnum < 1025UL) || (ulnum > 65535UL)) {
fprintf(stderr, "rtspd: invalid --port argument (%s)\n",
argv[arg]);
return 0;
}
port = (unsigned short)(lnum & 0xFFFFL);
port = (unsigned short)(ulnum & 0xFFFFUL);
arg++;
}
}

Просмотреть файл

@ -891,15 +891,14 @@ int main(int argc, char *argv[])
arg++;
if(argc>arg) {
char *endptr;
long lnum = -1;
lnum = strtol(argv[arg], &endptr, 10);
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
if((endptr != argv[arg] + strlen(argv[arg])) ||
((lnum != 0L) && ((lnum < 1025L) || (lnum > 65535L)))) {
((ulnum != 0UL) && ((ulnum < 1025UL) || (ulnum > 65535UL)))) {
fprintf(stderr, "sockfilt: invalid --port argument (%s)\n",
argv[arg]);
return 0;
}
port = (unsigned short)(lnum & 0xFFFFL);
port = (unsigned short)(ulnum & 0xFFFFUL);
arg++;
}
}
@ -909,15 +908,14 @@ int main(int argc, char *argv[])
arg++;
if(argc>arg) {
char *endptr;
long lnum = -1;
lnum = strtol(argv[arg], &endptr, 10);
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
if((endptr != argv[arg] + strlen(argv[arg])) ||
(lnum < 1025L) || (lnum > 65535L)) {
(ulnum < 1025UL) || (ulnum > 65535UL)) {
fprintf(stderr, "sockfilt: invalid --connect argument (%s)\n",
argv[arg]);
return 0;
}
connectport = (unsigned short)(lnum & 0xFFFFL);
connectport = (unsigned short)(ulnum & 0xFFFFUL);
arg++;
}
}

Просмотреть файл

@ -1131,15 +1131,14 @@ int main(int argc, char *argv[])
arg++;
if(argc>arg) {
char *endptr;
long lnum = -1;
lnum = strtol(argv[arg], &endptr, 10);
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
if((endptr != argv[arg] + strlen(argv[arg])) ||
(lnum < 1025L) || (lnum > 65535L)) {
(ulnum < 1025UL) || (ulnum > 65535UL)) {
fprintf(stderr, "sws: invalid --port argument (%s)\n",
argv[arg]);
return 0;
}
port = (unsigned short)(lnum & 0xFFFFL);
port = (unsigned short)(ulnum & 0xFFFFUL);
arg++;
}
}

Просмотреть файл

@ -709,15 +709,14 @@ int main(int argc, char **argv)
arg++;
if(argc>arg) {
char *endptr;
long lnum = -1;
lnum = strtol(argv[arg], &endptr, 10);
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
if((endptr != argv[arg] + strlen(argv[arg])) ||
(lnum < 1025L) || (lnum > 65535L)) {
(ulnum < 1025UL) || (ulnum > 65535UL)) {
fprintf(stderr, "tftpd: invalid --port argument (%s)\n",
argv[arg]);
return 0;
}
port = (unsigned short)(lnum & 0xFFFFL);
port = (unsigned short)(ulnum & 0xFFFFUL);
arg++;
}
}