aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-02-18 12:31:24 +0000
committerYang Tse <yangsita@gmail.com>2010-02-18 12:31:24 +0000
commit6e461e45c3623f53c682a7d08a2c38f096cc5b17 (patch)
tree5d52c5284bcdef74e053ad2889fa0df483d9ecea
parent19e089702a00e2cf36bcaaace06738774844daba (diff)
fix compiler warning
-rw-r--r--tests/server/rtspd.c7
-rw-r--r--tests/server/sockfilt.c14
-rw-r--r--tests/server/sws.c7
-rw-r--r--tests/server/tftpd.c7
4 files changed, 15 insertions, 20 deletions
diff --git a/tests/server/rtspd.c b/tests/server/rtspd.c
index 56111bd26..9fd5d3418 100644
--- a/tests/server/rtspd.c
+++ b/tests/server/rtspd.c
@@ -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++;
}
}
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
index 8abde8b51..1bd19924e 100644
--- a/tests/server/sockfilt.c
+++ b/tests/server/sockfilt.c
@@ -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++;
}
}
diff --git a/tests/server/sws.c b/tests/server/sws.c
index 42446a9ac..5e1b0dc70 100644
--- a/tests/server/sws.c
+++ b/tests/server/sws.c
@@ -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++;
}
}
diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c
index 152324904..8822f4bb6 100644
--- a/tests/server/tftpd.c
+++ b/tests/server/tftpd.c
@@ -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++;
}
}