Fix compiler warning
util.c: In function ‘util_getpass’: util.c:348: warning: comparison between signed and unsigned git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5018 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
f10d2908a5
commit
3e18e0838d
|
@ -306,7 +306,7 @@ util_getpass (char **lineptr, size_t *len, FILE *stream)
|
||||||
{
|
{
|
||||||
#define MAX_PASS_SIZE 128
|
#define MAX_PASS_SIZE 128
|
||||||
char *buf;
|
char *buf;
|
||||||
int i;
|
unsigned int i;
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
struct termios old, new;
|
struct termios old, new;
|
||||||
|
|
||||||
|
@ -338,14 +338,14 @@ util_getpass (char **lineptr, size_t *len, FILE *stream)
|
||||||
tcsetattr (fileno (stdout), TCSAFLUSH, &old);
|
tcsetattr (fileno (stdout), TCSAFLUSH, &old);
|
||||||
fputs("\n", stdout);
|
fputs("\n", stdout);
|
||||||
#endif
|
#endif
|
||||||
if (buf[i] == 0 || buf[i] == 3) {
|
if (buf[i] == 0 || buf[i] == 3) {
|
||||||
free(buf);
|
free(buf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
buf[i] = 0;
|
buf[i] = 0;
|
||||||
|
|
||||||
if (*lineptr && (!len || *len < i+1)) {
|
if (*lineptr && (!len || *len < i+1)) {
|
||||||
free(*lineptr);
|
free(*lineptr);
|
||||||
*lineptr = NULL;
|
*lineptr = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue