Commit 5ff6197f authored by Steven Miao's avatar Steven Miao Committed by 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: default avatarSteven Miao <realmz6@gmail.com>
Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent 1fa7b6a2
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
ENTRY(_strncpy) ENTRY(_strncpy)
CC = R2 == 0; CC = R2 == 0;
if CC JUMP 4f; if CC JUMP 6f;
P2 = R2 ; /* size */ P2 = R2 ; /* size */
P0 = R0 ; /* dst*/ P0 = R0 ; /* dst*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment