fixed #1342,并且适配Windows系统,文件以二进制方式打开

This commit is contained in:
zhu.junling
2022-10-24 09:09:05 +08:00
parent 879b37b283
commit 049b60f160
32 changed files with 80 additions and 80 deletions

View File

@@ -50,14 +50,14 @@ int sm9verify_main(int argc, char **argv)
} else if (!strcmp(*argv, "-in")) {
if (--argc < 1) goto bad;
infile = *(++argv);
if (!(infp = fopen(infile, "r"))) {
if (!(infp = fopen(infile, "rb"))) {
error_print();
goto end;
}
} else if (!strcmp(*argv, "-pubmaster")) {
if (--argc < 1) goto bad;
mpkfile = *(++argv);
if (!(mpkfp = fopen(mpkfile, "r"))) {
if (!(mpkfp = fopen(mpkfile, "rb"))) {
error_print();
goto end;
}
@@ -67,7 +67,7 @@ int sm9verify_main(int argc, char **argv)
} else if (!strcmp(*argv, "-sig")) {
if (--argc < 1) goto bad;
sigfile = *(++argv);
if (!(sigfp = fopen(sigfile, "r"))) {
if (!(sigfp = fopen(sigfile, "rb"))) {
error_print();
goto end;
}