diff options
| author | David Lamparter <equinox@diac24.net> | 2019-08-06 16:54:52 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2019-08-06 16:54:52 +0200 |
| commit | fefa5e0ff5af98d8258987e21422243926ee2b3c (patch) | |
| tree | 05ad830d4a48048156689b15a5c84df124964cb6 /lib/ptm_lib.c | |
| parent | 7040d52aafca16fb0048c1712a919d8209c54dc9 (diff) | |
*: fix ctype (isalpha & co.) casts
The correct cast for these is (unsigned char), because "char" could be
signed and thus have some negative value. isalpha & co. expect an int
arg that is positive, i.e. 0-255. So we need to cast to (unsigned char)
when calling any of these.
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/ptm_lib.c')
| -rw-r--r-- | lib/ptm_lib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ptm_lib.c b/lib/ptm_lib.c index 7f868beda4..a2ce9a0e2f 100644 --- a/lib/ptm_lib.c +++ b/lib/ptm_lib.c @@ -125,7 +125,7 @@ static int _ptm_lib_decode_header(csv_t *csv, int *msglen, int *version, } /* remove leading spaces */ for (i = j = 0; i < csv_field_len(fld); i++) { - if (!isspace((int)hdr[i])) { + if (!isspace((unsigned char)hdr[i])) { client_name[j] = hdr[i]; j++; } |
