pkcs15-init: coverity scan warning NEGATIVE-RETURNS
CID 402540: Argument cannot be negative (NEGATIVE_RETURNS)
This commit is contained in:
parent
61254f8651
commit
d3dbe444e1
|
@ -2130,18 +2130,21 @@ do_read_certificate(const char *name, const char *format, X509 **out)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int determine_filesize(const char *filename)
|
||||
static size_t determine_filesize(const char *filename)
|
||||
{
|
||||
FILE *fp;
|
||||
size_t size;
|
||||
long ll;
|
||||
|
||||
if ((fp = fopen(filename,"rb")) == NULL) {
|
||||
if ((fp = fopen(filename,"rb")) == NULL)
|
||||
util_fatal("Unable to open %s: %m", filename);
|
||||
}
|
||||
|
||||
fseek(fp,0L,SEEK_END);
|
||||
size = ftell(fp);
|
||||
ll = ftell(fp);
|
||||
if (ll == -1l)
|
||||
util_fatal("fseek/ftell error");
|
||||
|
||||
fclose(fp);
|
||||
return size;
|
||||
return (size_t)ll;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue