summaryrefslogtreecommitdiffstats
path: root/lib/libc/i386/string
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1994-10-27 11:36:11 +0000
committerbde <bde@FreeBSD.org>1994-10-27 11:36:11 +0000
commitcea563ca2556fbc923d7a26d8f8174baa563100e (patch)
tree52a24cd9e0a7d68e9974abfb4cda13b455c07415 /lib/libc/i386/string
parent71023484a794c741e08dec713b6298583250eae0 (diff)
downloadFreeBSD-src-cea563ca2556fbc923d7a26d8f8174baa563100e.zip
FreeBSD-src-cea563ca2556fbc923d7a26d8f8174baa563100e.tar.gz
Fix memchr(p, 0, 0) to return NULL instead of p.
Diffstat (limited to 'lib/libc/i386/string')
-rw-r--r--lib/libc/i386/string/memchr.S6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/i386/string/memchr.S b/lib/libc/i386/string/memchr.S
index 5ff0a34..12a9298 100644
--- a/lib/libc/i386/string/memchr.S
+++ b/lib/libc/i386/string/memchr.S
@@ -27,11 +27,11 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: memchr.S,v 1.1 1993/12/05 13:01:47 ats Exp $
+ * $Id: memchr.S,v 1.1 1994/08/05 01:18:28 wollman Exp $
*/
#if defined(LIBC_RCS) && !defined(lint)
- .asciz "$Id: memchr.S,v 1.1 1993/12/05 13:01:47 ats Exp $"
+ .asciz "$Id: memchr.S,v 1.1 1994/08/05 01:18:28 wollman Exp $"
#endif /* LIBC_RCS and not lint */
#include "DEFS.h"
@@ -49,7 +49,7 @@ ENTRY(memchr)
movl 8(%esp),%edi /* string address */
movl 12(%esp),%eax /* set character to search for */
movl 16(%esp),%ecx /* set length of search */
- testl %eax,%eax /* clear Z flag, for len == 0 */
+ testl %edi,%edi /* clear Z flag, for len == 0 */
cld /* set search forward */
repne /* search! */
scasb
OpenPOWER on IntegriCloud