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:
martin 2011-01-02 12:55:10 +00:00
parent f10d2908a5
commit 3e18e0838d
1 changed files with 3 additions and 3 deletions

View File

@ -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;
} }