Change ReadFile instances to app-specific naming.

ReadFile conflicts with a windows API.
This commit is contained in:
Anthony Hu
2023-08-04 13:47:34 -04:00
parent 90a6a14878
commit 30fda7ad38
2 changed files with 6 additions and 6 deletions

View File

@@ -60,7 +60,7 @@ static Asn1 asn1;
* @return 0 on success. * @return 0 on success.
* @return 1 on failure. * @return 1 on failure.
*/ */
static int ReadFile(FILE* fp, unsigned char** pdata, word32* plen) static int asn1App_ReadFile(FILE* fp, unsigned char** pdata, word32* plen)
{ {
int ret = 0; int ret = 0;
word32 len = 0; word32 len = 0;
@@ -121,7 +121,7 @@ static int PrintDer(FILE* fp)
unsigned char* data = NULL; unsigned char* data = NULL;
/* Load DER/BER file. */ /* Load DER/BER file. */
if (ReadFile(fp, &data, &len) != 0) { if (asn1App_ReadFile(fp, &data, &len) != 0) {
ret = 1; ret = 1;
} }
@@ -148,7 +148,7 @@ static int PrintBase64(FILE* fp)
unsigned char* data = NULL; unsigned char* data = NULL;
/* Load Base64 encoded file. */ /* Load Base64 encoded file. */
if (ReadFile(fp, &data, &len) != 0) { if (asn1App_ReadFile(fp, &data, &len) != 0) {
ret = 1; ret = 1;
} }
@@ -251,7 +251,7 @@ static int PrintPem(FILE* fp, int pem_skip)
word32 len = 0; word32 len = 0;
/* Load PEM file. */ /* Load PEM file. */
if (ReadFile(fp, &data, &len) != 0) { if (asn1App_ReadFile(fp, &data, &len) != 0) {
ret = 1; ret = 1;
} }

View File

@@ -94,7 +94,7 @@ static int StringToVal(const String2Val* map, int len, const char* str,
* @return 0 on success. * @return 0 on success.
* @return 1 on failure. * @return 1 on failure.
*/ */
static int ReadFile(FILE* fp, unsigned char** pdata, word32* plen) static int pemApp_ReadFile(FILE* fp, unsigned char** pdata, word32* plen)
{ {
int ret = 0; int ret = 0;
word32 len = 0; word32 len = 0;
@@ -944,7 +944,7 @@ int main(int argc, char* argv[])
} }
#endif #endif
/* Read all of PEM file. */ /* Read all of PEM file. */
if ((ret == 0) && (ReadFile(in_file, &in, &in_len) != 0)) { if ((ret == 0) && (pemApp_ReadFile(in_file, &in, &in_len) != 0)) {
fprintf(stderr, "Reading file failed\n"); fprintf(stderr, "Reading file failed\n");
ret = 1; ret = 1;
} }