GCC Code Coverage Report


Directory: ./
File: firmware/libfirmware/util/src/efistring.cpp
Date: 2025-10-03 00:57:22
Warnings: 1 unchecked decisions!
Coverage Exec Excl Total
Lines: 0.0% 0 0 6
Functions: 0.0% 0 0 1
Branches: 0.0% 0 0 6
Decisions: 0.0% 0 - 4

Line Branch Decision Exec Source
1 #include <rusefi/efistring.h>
2
3 // see strncpy man page
4 // this implementation helps avoiding following gcc error/warning:
5 // error: 'strncpy' output may be truncated copying xxx bytes from a string of length xxx
6
7 char *strlncpy(char *dest, const char *src, size_t size)
8 {
9 size_t i;
10
11 for (i = 0; (i < (size - 1)) && (src[i] != '\0'); i++)
12 dest[i] = src[i];
13 for ( ; i < size; i++)
14 dest[i] = '\0';
15
16 return dest;
17 }
18