diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2020-07-13 16:05:15 +0100 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2020-07-22 18:05:32 +0100 |
commit | 734c894234e800c924d97ae69d4774c9b00797dd (patch) | |
tree | 393dfe31d4c80be49eb070fbfe0b0389bd515533 /libctf | |
parent | 4533ed564d6953990210ba63c091009380ec2327 (diff) | |
download | gdb-734c894234e800c924d97ae69d4774c9b00797dd.zip gdb-734c894234e800c924d97ae69d4774c9b00797dd.tar.gz gdb-734c894234e800c924d97ae69d4774c9b00797dd.tar.bz2 |
libctf: fix isspace casts
isspace() notoriously takes an int, not a char. Cast uses
appropriately.
libctf/
* ctf-lookup.c (ctf_lookup_by_name): Adjust.
Diffstat (limited to 'libctf')
-rw-r--r-- | libctf/ChangeLog | 4 | ||||
-rw-r--r-- | libctf/ctf-lookup.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/libctf/ChangeLog b/libctf/ChangeLog index cfb9d01..9183d2b 100644 --- a/libctf/ChangeLog +++ b/libctf/ChangeLog @@ -1,5 +1,9 @@ 2020-07-22 Nick Alcock <nick.alcock@oracle.com> + * ctf-lookup.c (ctf_lookup_by_name): Adjust. + +2020-07-22 Nick Alcock <nick.alcock@oracle.com> + * ctf-archive.c (ctf_arc_bufopen): Endian-swap the archive magic number if needed. diff --git a/libctf/ctf-lookup.c b/libctf/ctf-lookup.c index 8daab63..57fb6c5 100644 --- a/libctf/ctf-lookup.c +++ b/libctf/ctf-lookup.c @@ -83,7 +83,7 @@ ctf_lookup_by_name (ctf_file_t *fp, const char *name) for (p = name, end = name + strlen (name); *p != '\0'; p = q) { - while (isspace (*p)) + while (isspace ((int) *p)) p++; /* Skip leading whitespace. */ if (p == end) @@ -133,13 +133,13 @@ ctf_lookup_by_name (ctf_file_t *fp, const char *name) strncmp (p, lp->ctl_prefix, (size_t) (q - p)) == 0) && (size_t) (q - p) >= lp->ctl_len) { - for (p += lp->ctl_len; isspace (*p); p++) + for (p += lp->ctl_len; isspace ((int) *p); p++) continue; /* Skip prefix and next whitespace. */ if ((q = strchr (p, '*')) == NULL) q = end; /* Compare until end. */ - while (isspace (q[-1])) + while (isspace ((int) q[-1])) q--; /* Exclude trailing whitespace. */ /* Expand and/or allocate storage for a slice of the name, then |