projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1fa7b6a
)
Blackfin: strncpy: fix handling of zero lengths
author
Steven Miao
<
[email protected]
>
Wed, 1 Jun 2011 07:52:41 +0000
(15:52 +0800)
committer
Mike Frysinger
<
[email protected]
>
Fri, 3 Jun 2011 15:05:36 +0000
(11:05 -0400)
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: Steven Miao <
[email protected]
>
Signed-off-by: Mike Frysinger <
[email protected]
>
arch/blackfin/lib/strncpy.S
patch
|
blob
|
history
diff --git
a/arch/blackfin/lib/strncpy.S
b/arch/blackfin/lib/strncpy.S
index f3931d50b4a715a50878363a43bd14e9c63b9dd1..2c07dddac9956bd24da0603910c9a7d35957f42b 100644
(file)
--- a/
arch/blackfin/lib/strncpy.S
+++ b/
arch/blackfin/lib/strncpy.S
@@
-25,7
+25,7
@@
ENTRY(_strncpy)
CC = R2 == 0;
- if CC JUMP
4
f;
+ if CC JUMP
6
f;
P2 = R2 ; /* size */
P0 = R0 ; /* dst*/