Fix strchr, strrchr implementation: convert c to char
(according to standard). Discussed with: andrew Reviewed by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8239
This commit is contained in:
parent
5975e53d40
commit
2302bd3539
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=307219
@ -44,7 +44,12 @@ __FBSDID("$FreeBSD$");
|
||||
.abicalls
|
||||
#endif
|
||||
|
||||
/*
|
||||
* char *
|
||||
* strchr(const char *s, int c);
|
||||
*/
|
||||
LEAF(strchr)
|
||||
and a1, a1, 0xff
|
||||
1:
|
||||
lbu a2, 0(a0) # get a byte
|
||||
PTR_ADDU a0, a0, 1
|
||||
|
@ -44,8 +44,13 @@ __FBSDID("$FreeBSD$");
|
||||
.abicalls
|
||||
#endif
|
||||
|
||||
/*
|
||||
* char *
|
||||
* strrchr(const char *s, int c);
|
||||
*/
|
||||
LEAF(strrchr)
|
||||
move v0, zero # default if not found
|
||||
and a1, a1, 0xff
|
||||
1:
|
||||
lbu a3, 0(a0) # get a byte
|
||||
PTR_ADDU a0, a0, 1
|
||||
|
Loading…
Reference in New Issue
Block a user