Annotation of solidite/libc/string.c, revision 1.1

1.1     ! user        1: /* Copyright (c) 2026 The Solidite Developers
        !             2:  *
        !             3:  * This program is free software: you can redistribute it and/or modify it
        !             4:  * under the terms of the GNU Affero General Public License as published by the
        !             5:  * Free Software Foundation, either version 3 of the License, or (at your
        !             6:  * option) any later version.
        !             7:  *
        !             8:  * This program is distributed in the hope that it will be useful, but WITHOUT
        !             9:  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
        !            10:  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
        !            11:  * for more details.
        !            12:  *
        !            13:  * You should have received a copy of the GNU Affero General Public License
        !            14:  * along with this program. If not, see <https://www.gnu.org/licenses/>. */
        !            15: 
        !            16: #include "include/string.h"
        !            17: 
        !            18: void *memcpy(void *restrict dest, const void *restrict src, size_t n) {
        !            19:   char *d = (char *)dest;
        !            20:   const char *s = (const char *)src;
        !            21: 
        !            22:   for (size_t i = 0; i < n; ++i) {
        !            23:     d[i] = s[i];
        !            24:   }
        !            25:   return dest;
        !            26: }
        !            27: 
        !            28: size_t strlen(const char *s) {
        !            29:   size_t ret = 0;
        !            30:   while (*s != '\0')
        !            31:     ++ret;
        !            32:   return ret;
        !            33: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>