Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Zlib
提交
0b223371
T
Third Party Zlib
项目概览
OpenHarmony
/
Third Party Zlib
接近 2 年 前同步成功
通知
18
Star
112
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Zlib
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0b223371
编写于
7月 28, 2015
作者:
M
Mark Adler
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Avoid use of reallocf() in test/infcover.c.
上级
0db8fd37
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
8 addition
and
8 deletion
+8
-8
test/infcover.c
test/infcover.c
+8
-8
未找到文件。
test/infcover.c
浏览文件 @
0b223371
...
@@ -237,14 +237,14 @@ local void mem_done(z_stream *strm, char *prefix)
...
@@ -237,14 +237,14 @@ local void mem_done(z_stream *strm, char *prefix)
/* Decode a hexadecimal string, set *len to length, in[] to the bytes. This
/* Decode a hexadecimal string, set *len to length, in[] to the bytes. This
decodes liberally, in that hex digits can be adjacent, in which case two in
decodes liberally, in that hex digits can be adjacent, in which case two in
a row writes a byte. Or they can
delimited by any non-hex character, where
a row writes a byte. Or they can
be delimited by any non-hex character,
the delimiters are ignored except when a single hex digit is followed by a
where the delimiters are ignored except when a single hex digit is followed
delimiter in which case that single digit writes a byte. The returned
by a delimiter, where that single digit writes a byte. The returned data is
data is allocated and must eventually be freed. NULL is returned if out of
allocated and must eventually be freed. NULL is returned if out of memory.
memory.
If the length is not needed, then len can be NULL. */
If the length is not needed, then len can be NULL. */
local
unsigned
char
*
h2b
(
const
char
*
hex
,
unsigned
*
len
)
local
unsigned
char
*
h2b
(
const
char
*
hex
,
unsigned
*
len
)
{
{
unsigned
char
*
in
;
unsigned
char
*
in
,
*
re
;
unsigned
next
,
val
;
unsigned
next
,
val
;
in
=
malloc
((
strlen
(
hex
)
+
1
)
>>
1
);
in
=
malloc
((
strlen
(
hex
)
+
1
)
>>
1
);
...
@@ -268,8 +268,8 @@ local unsigned char *h2b(const char *hex, unsigned *len)
...
@@ -268,8 +268,8 @@ local unsigned char *h2b(const char *hex, unsigned *len)
}
while
(
*
hex
++
);
/* go through the loop with the terminating null */
}
while
(
*
hex
++
);
/* go through the loop with the terminating null */
if
(
len
!=
NULL
)
if
(
len
!=
NULL
)
*
len
=
next
;
*
len
=
next
;
in
=
reallocf
(
in
,
next
);
re
=
realloc
(
in
,
next
);
return
in
;
return
re
==
NULL
?
in
:
re
;
}
}
/* generic inflate() run, where hex is the hexadecimal input data, what is the
/* generic inflate() run, where hex is the hexadecimal input data, what is the
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录