Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
9c4279b6
Commit
9c4279b6
authored
Aug 05, 2003
by
Paul Mackerras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: Make strncpy clear the unused part of the destination.
parent
7e85e094
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
arch/ppc/lib/string.S
arch/ppc/lib/string.S
+8
-0
No files found.
arch/ppc/lib/string.S
View file @
9c4279b6
...
@@ -78,6 +78,8 @@ _GLOBAL(strcpy)
...
@@ -78,6 +78,8 @@ _GLOBAL(strcpy)
bne
1
b
bne
1
b
blr
blr
/*
This
clears
out
any
unused
part
of
the
destination
buffer
,
just
as
the
libc
version
does
.
--
paulus
*/
_GLOBAL
(
strncpy
)
_GLOBAL
(
strncpy
)
cmpwi
0
,
r5
,
0
cmpwi
0
,
r5
,
0
beqlr
beqlr
...
@@ -88,6 +90,12 @@ _GLOBAL(strncpy)
...
@@ -88,6 +90,12 @@ _GLOBAL(strncpy)
cmpwi
0
,
r0
,
0
cmpwi
0
,
r0
,
0
stbu
r0
,
1
(
r6
)
stbu
r0
,
1
(
r6
)
bdnzf
2
,
1
b
/*
dec
ctr
,
branch
if
ctr
!=
0
&&
!
cr0
.
eq
*/
bdnzf
2
,
1
b
/*
dec
ctr
,
branch
if
ctr
!=
0
&&
!
cr0
.
eq
*/
bnelr
/*
if
we
didn
't hit a null char, we'
re
done
*/
mfctr
r5
cmpwi
0
,
r5
,
0
/*
any
space
left
in
destination
buffer
?
*/
beqlr
/*
we
know
r0
==
0
here
*/
2
:
stbu
r0
,
1
(
r6
)
/*
clear
it
out
if
so
*/
bdnz
2
b
blr
blr
_GLOBAL
(
strcat
)
_GLOBAL
(
strcat
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment