Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Oct 2016 15:23:53 +0000 (UTC)
From:      Ruslan Bukin <br@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r307219 - head/lib/libc/mips/string
Message-ID:  <201610131523.u9DFNr8N098526@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: br
Date: Thu Oct 13 15:23:53 2016
New Revision: 307219
URL: https://svnweb.freebsd.org/changeset/base/307219

Log:
  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

Modified:
  head/lib/libc/mips/string/strchr.S
  head/lib/libc/mips/string/strrchr.S

Modified: head/lib/libc/mips/string/strchr.S
==============================================================================
--- head/lib/libc/mips/string/strchr.S	Thu Oct 13 14:41:05 2016	(r307218)
+++ head/lib/libc/mips/string/strchr.S	Thu Oct 13 15:23:53 2016	(r307219)
@@ -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

Modified: head/lib/libc/mips/string/strrchr.S
==============================================================================
--- head/lib/libc/mips/string/strrchr.S	Thu Oct 13 14:41:05 2016	(r307218)
+++ head/lib/libc/mips/string/strrchr.S	Thu Oct 13 15:23:53 2016	(r307219)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610131523.u9DFNr8N098526>