1
0
mirror of https://github.com/fumiama/base16384.git synced 2026-06-10 05:10:24 +08:00

尝试修复#19

- 移除未使用的参数 int blen
- 完善文档、注释
- 完善文件名错误检测
- 修复 encbuf, decbuf 处理逻辑
This commit is contained in:
源文雨
2023-08-25 21:53:18 +08:00
parent 7897031513
commit 5dc272b8b7
7 changed files with 69 additions and 57 deletions

View File

@@ -1,6 +1,6 @@
/* base1464.c
* This file is part of the base16384 distribution (https://github.com/fumiama/base16384).
* Copyright (c) 2022 Fumiama Minamoto.
* Copyright (c) 2022-2023 Fumiama Minamoto.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -62,7 +62,7 @@
// #define DEBUG
int base16384_encode(const char* data, int dlen, char* buf, int blen) {
int base16384_encode(const char* data, int dlen, char* buf) {
int outlen = dlen / 7 * 8;
int offset = dlen % 7;
switch(offset) { // 算上偏移标志字符占用的2字节
@@ -136,7 +136,7 @@ int base16384_encode(const char* data, int dlen, char* buf, int blen) {
return outlen;
}
int base16384_decode(const char* data, int dlen, char* buf, int blen) {
int base16384_decode(const char* data, int dlen, char* buf) {
int outlen = dlen;
int offset = 0;
if(data[dlen-2] == '=') {