ports.c
1 /* FinnOS - Beowulf cluster linux distro. 2 * If you find this software useful, please consider supporting future development. 3 * Donate what you believe this software is worth at: https://SammTech.net/donate 4 * Copyright (c) 2025 Samm and FinnOS Contributors. 5 * Licensed under the GNU General Public License, version 2 (GPLv2). 6 * See LICENSE.txt for details. 7 */ 8 9 #include <stdio.h> 10 11 size_t strnlen_port(const char* str, size_t max_len) { 12 size_t i = 0; 13 if (!str) return 0; 14 for (; i < max_len && str[i] != '\0'; i++); 15 return i; 16 }