[PATCH] memmem.c and strstr.c: do not require -std=c99

Corinna Vinschen vinschen@redhat.com
Wed Aug 14 08:42:00 GMT 2019


On Aug 13 02:00, Giacomo Tesio wrote:
> ---
>  newlib/libc/string/memmem.c |  3 ++-
>  newlib/libc/string/strstr.c | 12 ++++++++----
>  2 files changed, 10 insertions(+), 5 deletions(-)
> 
> diff --git a/newlib/libc/string/memmem.c b/newlib/libc/string/memmem.c
> index 55d2459aa..65267b9c5 100644
> --- a/newlib/libc/string/memmem.c
> +++ b/newlib/libc/string/memmem.c
> @@ -143,10 +143,11 @@ memmem (const void *haystack, size_t hs_len,
> const void *needle, size_t ne_len)
>    size_t tmp, shift1;
>    size_t m1 = ne_len - 1;
>    size_t offset = 0;
> +  int i;
> 
>    /* Initialize bad character shift hash table.  */
>    memset (shift, 0, sizeof (shift));
> -  for (int i = 1; i < m1; i++)
> +  for (i = 1; i < m1; i++)
>      shift[hash2 (ne + i)] = i;
>    shift1 = m1 - shift[hash2 (ne + m1)];
>    shift[hash2 (ne + m1)] = m1;
> [...]

Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20190814/d01f3a4b/attachment.sig>


More information about the Newlib mailing list