1
0
mirror of https://github.com/fumiama/base16384.git synced 2026-06-05 02:00:31 +08:00
This commit is contained in:
源文雨
2022-10-16 19:22:05 +08:00
parent a877d8f062
commit bcbec0bbf5

6
file.c
View File

@@ -154,6 +154,7 @@ base16384_err_t base16384_encode_fd(int input, int output, char* encbuf, char* d
static int is_next_end(FILE* fp) {
int ch = fgetc(fp);
if(ch == EOF) return 0;
if(ch == '=') return fgetc(fp);
ungetc(ch, fp);
return 0;
@@ -246,13 +247,12 @@ base16384_err_t base16384_decode_fp(FILE* input, FILE* output, char* encbuf, cha
}
static int is_next_end_fd(int fd) {
char ch;
char ch = 0;
read(fd, &ch, 1);
if(ch == '=') {
read(fd, &ch, 1);
return (int)ch;
}
return 0;
return (int)ch;
}
base16384_err_t base16384_decode_fd(int input, int output, char* encbuf, char* decbuf) {