summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/index.c
diff options
context:
space:
mode:
authorderaadt <>2014-11-30 19:43:57 +0000
committerderaadt <>2014-11-30 19:43:57 +0000
commit3539e3fa3e1f8ac6b4177476a424681e58c76af5 (patch)
tree82fa98088bf55df432f5bac1dd59e9f100a1cac9 /src/lib/libc/string/index.c
parentc65fff479ff8dc713956bcf5d92883f19a479d84 (diff)
downloadopenbsd-3539e3fa3e1f8ac6b4177476a424681e58c76af5.tar.gz
openbsd-3539e3fa3e1f8ac6b4177476a424681e58c76af5.tar.bz2
openbsd-3539e3fa3e1f8ac6b4177476a424681e58c76af5.zip
restructure libc/string + libc/arch/*/string coperation regarding
(potentially) MD versions (function dependent, not filename dependent) split out memcpy/memmove/bcopy and strchr/index/strrchr/rindex Bring back amd64 .S versions And the final touch: switch all architectures temporarily to MI memcpy.c, which contains syslog + abort for overlapping copies. A nice harsh undefined behaviour. We will clean the entire userland of the remaining issues in this catagory, then switch to the optimised memcpy which skips the memmove check. I tried to cut this change into pieces, but testing each sub-step on every architecture is too time consuming and mindnumbing. ok miod
Diffstat (limited to 'src/lib/libc/string/index.c')
-rw-r--r--src/lib/libc/string/index.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/lib/libc/string/index.c b/src/lib/libc/string/index.c
index 50e9ca35ab..ebae15afe7 100644
--- a/src/lib/libc/string/index.c
+++ b/src/lib/libc/string/index.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: index.c,v 1.5 2005/08/08 08:05:37 espie Exp $ */ 1/* $OpenBSD: index.c,v 1.6 2014/11/30 19:43:56 deraadt Exp $ */
2/*- 2/*-
3 * Copyright (c) 1990 The Regents of the University of California. 3 * Copyright (c) 1990 The Regents of the University of California.
4 * All rights reserved. 4 * All rights reserved.
@@ -31,11 +31,7 @@
31#include <string.h> 31#include <string.h>
32 32
33char * 33char *
34#ifdef STRCHR
35strchr(const char *p, int ch)
36#else
37index(const char *p, int ch) 34index(const char *p, int ch)
38#endif
39{ 35{
40 for (;; ++p) { 36 for (;; ++p) {
41 if (*p == ch) 37 if (*p == ch)