Blame src/u16_wcsrchr.c

332506
/*******************************************************************/
332506
/*  u16ports: u16 variants of wide character string functions.     */
332506
/*  Copyright (C) 2017  Z. Gilboa                                  */
332506
/*  Released under the Standard MIT License; see COPYING.U16PORTS. */
332506
/*******************************************************************/
332506
332506
#include <stdint.h>
332506
#include <u16ports/u16ports.h>
332506
332506
uint16_t * u16_wcsrchr(const uint16_t * src, uint16_t code)
332506
{
332506
	const uint16_t * wch;
332506
332506
	wch = src + u16_wcslen(src);
332506
332506
	if (!code)
332506
		return (uint16_t *)wch;
332506
332506
	for (--wch; wch>=src; wch--)
332506
		if (*wch == code)
332506
			return (uint16_t *)wch;
332506
332506
	return 0;
332506
}