blob: 10099624f9ed2491ae416082ca9787e4eb700973 (
plain) (
tree)
|
|
/*
Copyright 2022-2023 Gabriel Jensen.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0>.
*/
#include <zp/mem.h>
void * zp_memsrh(void const * const bufptr,char unsigned const val,zp_siz const num) {
char unsigned const * buf = bufptr;
char unsigned const * const stp = buf+num;
while (buf != stp) {
char unsigned const * const addr = buf++;
zp_unlik (*addr == val) {return (char unsigned *)addr;}
}
return zp_nulptr;
}
|