diff options
author | Yang Tse <yangsita@gmail.com> | 2010-02-18 12:31:24 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2010-02-18 12:31:24 +0000 |
commit | 6e461e45c3623f53c682a7d08a2c38f096cc5b17 (patch) | |
tree | 5d52c5284bcdef74e053ad2889fa0df483d9ecea /tests | |
parent | 19e089702a00e2cf36bcaaace06738774844daba (diff) |
fix compiler warning
Diffstat (limited to 'tests')
-rw-r--r-- | tests/server/rtspd.c | 7 | ||||
-rw-r--r-- | tests/server/sockfilt.c | 14 | ||||
-rw-r--r-- | tests/server/sws.c | 7 | ||||
-rw-r--r-- | tests/server/tftpd.c | 7 |
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++; } } |