libctf: fix isspace casts
isspace() notoriously takes an int, not a char. Cast uses appropriately. libctf/ * ctf-lookup.c (ctf_lookup_by_name): Adjust.
This commit is contained in:
parent
4533ed564d
commit
734c894234
@ -1,3 +1,7 @@
|
|||||||
|
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>
|
2020-07-22 Nick Alcock <nick.alcock@oracle.com>
|
||||||
|
|
||||||
* ctf-archive.c (ctf_arc_bufopen): Endian-swap the archive magic
|
* ctf-archive.c (ctf_arc_bufopen): Endian-swap the archive magic
|
||||||
|
@ -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)
|
for (p = name, end = name + strlen (name); *p != '\0'; p = q)
|
||||||
{
|
{
|
||||||
while (isspace (*p))
|
while (isspace ((int) *p))
|
||||||
p++; /* Skip leading whitespace. */
|
p++; /* Skip leading whitespace. */
|
||||||
|
|
||||||
if (p == end)
|
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) &&
|
strncmp (p, lp->ctl_prefix, (size_t) (q - p)) == 0) &&
|
||||||
(size_t) (q - p) >= lp->ctl_len)
|
(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. */
|
continue; /* Skip prefix and next whitespace. */
|
||||||
|
|
||||||
if ((q = strchr (p, '*')) == NULL)
|
if ((q = strchr (p, '*')) == NULL)
|
||||||
q = end; /* Compare until end. */
|
q = end; /* Compare until end. */
|
||||||
|
|
||||||
while (isspace (q[-1]))
|
while (isspace ((int) q[-1]))
|
||||||
q--; /* Exclude trailing whitespace. */
|
q--; /* Exclude trailing whitespace. */
|
||||||
|
|
||||||
/* Expand and/or allocate storage for a slice of the name, then
|
/* Expand and/or allocate storage for a slice of the name, then
|
||||||
|
Loading…
Reference in New Issue
Block a user