aboutsummaryrefslogtreecommitdiffstats
path: root/src/wchar/wcsstr.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/wchar/wcsstr.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/wchar/wcsstr.c b/src/wchar/wcsstr.c
index 0ae7b71..1a4786e 100644
--- a/src/wchar/wcsstr.c
+++ b/src/wchar/wcsstr.c
@@ -16,11 +16,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <wchar.h>
-#include <inttypes.h>
+#include <stdint.h>
+#include <unistd.h>
+#include <alloca.h>
+#include <wctype.h>
#define WIDE
+# pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
+
+
/**
* This function is identical to `wcsstr`.
@@ -155,7 +161,7 @@ wchar_t* wmemmem(const wchar_t* haystack, size_t haystack_length,
if (haystack_length < needle_length)
return NULL;
if (haystack_length == needle_length)
- return !wmemcmp(haystack, haystack_length, haystack_length) ? haystack : NULL;
+ return !wmemcmp(haystack, needle, haystack_length) ? haystack : NULL;
#include "../string/substring.h"
}
@@ -180,7 +186,7 @@ wchar_t* wmemcasemem(const wchar_t* haystack, size_t haystack_length,
if (haystack_length < needle_length)
return NULL;
if (haystack_length == needle_length)
- return !wmemcasecmp(haystack, haystack_length, haystack_length) ? haystack : NULL;
+ return !wmemcasecmp(haystack, needle, haystack_length) ? haystack : NULL;
#define CASE
#include "../string/substring.h"
#undef CASE