]> git.baikalelectronics.ru Git - kernel.git/commit
Blackfin: strncpy: fix handling of zero lengths
authorSteven Miao <realmz6@gmail.com>
Wed, 1 Jun 2011 07:52:41 +0000 (15:52 +0800)
committerMike Frysinger <vapier@gentoo.org>
Fri, 3 Jun 2011 15:05:36 +0000 (11:05 -0400)
commit8a32ab6d2ae9230da2bae0f7caff55b9ad4d77a2
tree4d40c726ed8b09f1cd184f972641edc99a8c07b8
parent1981e8afde848cb23fcf84c50b8e9b8817907f73
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: Steven Miao <realmz6@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
arch/blackfin/lib/strncpy.S