mirror of
https://github.com/nmap/nmap.git
synced 2026-02-07 22:16:33 +00:00
Changd some calls to ctype functions so that their arguments are explicitly cast
to type int.
This commit is contained in:
@@ -422,6 +422,34 @@ Index: src/intf.c
|
||||
ret = 0;
|
||||
while (fgets(buf, sizeof(buf), fp) != NULL) {
|
||||
|
||||
o Added casts to calls of ctype functions so that their arguments are explicitly
|
||||
cast to (int) [Josh Marlow]
|
||||
Index: src/blob.c
|
||||
===================================================================
|
||||
--- src/blob.c (revision 14763)
|
||||
+++ src/blob.c (working copy)
|
||||
@@ -162,7 +162,7 @@
|
||||
for (p = (char *)fmt; *p != '\0'; p++) {
|
||||
if (*p == '%') {
|
||||
p++;
|
||||
- if (isdigit((int)*p)) {
|
||||
+ if (isdigit((int) (unsigned char) *p)) {
|
||||
len = strtol(p, &p, 10);
|
||||
} else if (*p == '*') {
|
||||
len = va_arg(*ap, int);
|
||||
Index: src/intf-win32.c
|
||||
===================================================================
|
||||
--- src/intf-win32.c (revision 14763)
|
||||
+++ src/intf-win32.c (working copy)
|
||||
@@ -234,7 +234,7 @@
|
||||
char *p = (char *)device;
|
||||
int n, type = _ifcombo_type(device);
|
||||
|
||||
- while (isalpha(*p)) p++;
|
||||
+ while (isalpha((int) (unsigned char) *p)) p++;
|
||||
n = atoi(p);
|
||||
|
||||
return (intf->ifcombo[type].idx[n]);
|
||||
|
||||
|
||||
===CHANGES ALREADY MERGED TO UPSTREAM LIBDNET GO BELOW THIS LINE===
|
||||
|
||||
@@ -162,7 +162,7 @@ blob_fmt(blob_t *b, int pack, const char *fmt, va_list *ap)
|
||||
for (p = (char *)fmt; *p != '\0'; p++) {
|
||||
if (*p == '%') {
|
||||
p++;
|
||||
if (isdigit((int)*p)) {
|
||||
if (isdigit((int) (unsigned char) *p)) {
|
||||
len = strtol(p, &p, 10);
|
||||
} else if (*p == '*') {
|
||||
len = va_arg(*ap, int);
|
||||
|
||||
@@ -234,7 +234,7 @@ _find_ifindex(intf_t *intf, const char *device)
|
||||
char *p = (char *)device;
|
||||
int n, type = _ifcombo_type(device);
|
||||
|
||||
while (isalpha(*p)) p++;
|
||||
while (isalpha((int) (unsigned char) *p)) p++;
|
||||
n = atoi(p);
|
||||
|
||||
return (intf->ifcombo[type].idx[n]);
|
||||
|
||||
Reference in New Issue
Block a user