提交 5ff6197f 编写于 作者: S Steven Miao 提交者: Mike Frysinger

Blackfin: strncpy: fix handling of zero lengths

The jump to 4f will cause the NUL padding loop to run at least one time,
so if string length is zero just jump to the end.  Otherwise we wrongly
write one NUL byte when size==0.
Signed-off-by: NSteven Miao <realmz6@gmail.com>
Signed-off-by: NMike Frysinger <vapier@gentoo.org>
上级 1fa7b6a2
......@@ -25,7 +25,7 @@
ENTRY(_strncpy)
CC = R2 == 0;
if CC JUMP 4f;
if CC JUMP 6f;
P2 = R2 ; /* size */
P0 = R0 ; /* dst*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册