summaryrefslogtreecommitdiff
path: root/src/certtool-common.c
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2020-05-30 11:06:57 +0200
committerDaiki Ueno <ueno@gnu.org>2020-05-30 11:10:12 +0200
commit14e2203ce5d7a6bbe050861a1206873a040674e3 (patch)
tree11e6dc0698f3d4840dc01c2c537064acf79ad685 /src/certtool-common.c
parent1976600876a3f0724b52c61d96998560dc4c0acb (diff)
downloadgnutls-tmp-fileio.tar.gz
build: write "FILE *fp" instead of "FILE *fd"tmp-fileio
This makes it clear that "fd" is not a file descriptor but a FILE pointer. Suggested by Tim Rühsen. Signed-off-by: Daiki Ueno <ueno@gnu.org>
Diffstat (limited to 'src/certtool-common.c')
-rw-r--r--src/certtool-common.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/certtool-common.c b/src/certtool-common.c
index ade6b1b569..3af2d08080 100644
--- a/src/certtool-common.c
+++ b/src/certtool-common.c
@@ -389,7 +389,7 @@ gnutls_x509_crt_t load_cert(int mand, common_info_st * info)
gnutls_x509_crt_t *load_cert_list(int mand, size_t * crt_size,
common_info_st * info)
{
- FILE *fd;
+ FILE *fp;
static gnutls_x509_crt_t *crt;
int ret;
gnutls_datum_t dat;
@@ -409,18 +409,18 @@ gnutls_x509_crt_t *load_cert_list(int mand, size_t * crt_size,
return NULL;
}
- fd = fopen(info->cert, "r");
- if (fd == NULL) {
+ fp = fopen(info->cert, "r");
+ if (fp == NULL) {
fprintf(stderr, "Could not open %s\n", info->cert);
app_exit(1);
}
- fix_lbuffer(file_size(fd));
+ fix_lbuffer(file_size(fp));
- size = fread(lbuffer, 1, lbuffer_size - 1, fd);
+ size = fread(lbuffer, 1, lbuffer_size - 1, fp);
lbuffer[size] = 0;
- fclose(fd);
+ fclose(fp);
dat.data = (void *) lbuffer;
dat.size = size;
@@ -448,7 +448,7 @@ gnutls_x509_crt_t *load_cert_list(int mand, size_t * crt_size,
gnutls_x509_crl_t *load_crl_list(int mand, size_t * crl_size,
common_info_st * info)
{
- FILE *fd;
+ FILE *fp;
static gnutls_x509_crl_t *crl;
unsigned int crl_max;
int ret;
@@ -467,18 +467,18 @@ gnutls_x509_crl_t *load_crl_list(int mand, size_t * crl_size,
return NULL;
}
- fd = fopen(info->crl, "r");
- if (fd == NULL) {
+ fp = fopen(info->crl, "r");
+ if (fp == NULL) {
fprintf(stderr, "Could not open %s\n", info->crl);
app_exit(1);
}
- fix_lbuffer(file_size(fd));
+ fix_lbuffer(file_size(fp));
- size = fread(lbuffer, 1, lbuffer_size - 1, fd);
+ size = fread(lbuffer, 1, lbuffer_size - 1, fp);
lbuffer[size] = 0;
- fclose(fd);
+ fclose(fp);
dat.data = (void *) lbuffer;
dat.size = size;