/* 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 . */ #include void * zap_srch(void const * const voidbuf,zap_i8 const val,zap_sz const num) { unsigned char const * buf = voidbuf; unsigned char const * const stop = buf + num; while (buf != stop) { unsigned char const * addr = buf++; if (*addr == val) return (void *)addr; } return zap_nullptr; }