Fix signedness mismatch, and use an explicit cast when calling ctype functions.
git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@380 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
parent
9a4dc99d0b
commit
bce6b0d2a5
|
@ -52,7 +52,7 @@
|
||||||
char *
|
char *
|
||||||
openpam_readline(FILE *f, int *lineno, size_t *lenp)
|
openpam_readline(FILE *f, int *lineno, size_t *lenp)
|
||||||
{
|
{
|
||||||
unsigned char *line;
|
char *line;
|
||||||
size_t len, size;
|
size_t len, size;
|
||||||
int ch;
|
int ch;
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ openpam_readline(FILE *f, int *lineno, size_t *lenp)
|
||||||
|
|
||||||
#define line_putch(ch) do { \
|
#define line_putch(ch) do { \
|
||||||
if (len >= size - 1) { \
|
if (len >= size - 1) { \
|
||||||
unsigned char *tmp = realloc(line, size *= 2); \
|
char *tmp = realloc(line, size *= 2); \
|
||||||
if (tmp == NULL) \
|
if (tmp == NULL) \
|
||||||
goto fail; \
|
goto fail; \
|
||||||
line = tmp; \
|
line = tmp; \
|
||||||
|
@ -83,7 +83,7 @@ openpam_readline(FILE *f, int *lineno, size_t *lenp)
|
||||||
/* eof */
|
/* eof */
|
||||||
if (ch == EOF) {
|
if (ch == EOF) {
|
||||||
/* remove trailing whitespace */
|
/* remove trailing whitespace */
|
||||||
while (len > 0 && isspace(line[len - 1]))
|
while (len > 0 && isspace((int)line[len - 1]))
|
||||||
--len;
|
--len;
|
||||||
line[len] = '\0';
|
line[len] = '\0';
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
|
@ -96,7 +96,7 @@ openpam_readline(FILE *f, int *lineno, size_t *lenp)
|
||||||
++*lineno;
|
++*lineno;
|
||||||
|
|
||||||
/* remove trailing whitespace */
|
/* remove trailing whitespace */
|
||||||
while (len > 0 && isspace(line[len - 1]))
|
while (len > 0 && isspace((int)line[len - 1]))
|
||||||
--len;
|
--len;
|
||||||
line[len] = '\0';
|
line[len] = '\0';
|
||||||
/* skip blank lines */
|
/* skip blank lines */
|
||||||
|
|
Loading…
Reference in New Issue