summaryrefslogtreecommitdiff
path: root/lib/mbsstr.c
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2014-09-30 18:22:54 +0400
committerIgor Pashev <pashev.igor@gmail.com>2014-09-30 18:22:54 +0400
commit08bc9e01c274a01d107b348f921e1c74dd04bd3a (patch)
tree25348bff03c29d9dd6c6dd96bf82c7c9f9265ccf /lib/mbsstr.c
parentb9c7373f203ab77c58cb6b131f8b58236ea337a2 (diff)
parentc18578632fd3c9e513e613a86ba2b7c4ebee6c45 (diff)
downloadcoreutils-08bc9e01c274a01d107b348f921e1c74dd04bd3a.tar.gz
Merge tag 'upstream/8.23'
Upstream version 8.23
Diffstat (limited to 'lib/mbsstr.c')
-rw-r--r--lib/mbsstr.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/mbsstr.c b/lib/mbsstr.c
index f84e689e..1ae9fe42 100644
--- a/lib/mbsstr.c
+++ b/lib/mbsstr.c
@@ -1,5 +1,5 @@
/* Searching in a string.
- Copyright (C) 2005-2013 Free Software Foundation, Inc.
+ Copyright (C) 2005-2014 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2005.
This program is free software: you can redistribute it and/or modify
@@ -45,11 +45,13 @@ knuth_morris_pratt_multibyte (const char *haystack, const char *needle,
size_t *table;
/* Allocate room for needle_mbchars and the table. */
- char *memory = (char *) nmalloca (m, sizeof (mbchar_t) + sizeof (size_t));
+ void *memory = nmalloca (m, sizeof (mbchar_t) + sizeof (size_t));
+ void *table_memory;
if (memory == NULL)
return false;
- needle_mbchars = (mbchar_t *) memory;
- table = (size_t *) (memory + m * sizeof (mbchar_t));
+ needle_mbchars = memory;
+ table_memory = needle_mbchars + m;
+ table = table_memory;
/* Fill needle_mbchars. */
{