LOG_ERROR
- Macro
- October 8, 2025
Table of Contents
LOG_ERROR
LOG_ERRORDescription
Writes an error-level log message. …[in] : Format string and arguments following printf-style syntax.
Success
Error message written to log output
Failure
Logging fails silently (output not guaranteed)
Usage example (Cross-references)
- In
JSON.c:16:
// starting of an object
if (StrIterPeek(&si) != '{') {
LOG_ERROR("Invalid object start. Expected '{'.");
return saved_si;
}
- In
JSON.c:29:
if (expect_comma) {
if (StrIterPeek(&si) != ',') {
LOG_ERROR(
"Expected ',' between key/value pairs in object. Invalid "
"JSON object."
- In
JSON.c:44:
read_si = JReadString(si, &key);
if (read_si.pos == si.pos) {
LOG_ERROR("Failed to read string key in object. Invalid JSON");
StrDeinit(&key);
return saved_si;
- In
JSON.c:52:
if (StrIterPeek(&si) != ':') {
LOG_ERROR("Expected ':' after key string. Failed to read JSON");
StrDeinit(&key);
return saved_si;
- In
JSON.c:64:
// if still no advancement in read position
if (read_si.pos == si.pos) {
LOG_ERROR("Failed to parse value. Invalid JSON.");
StrDeinit(&key);
return saved_si;
- In
JSON.c:81:
char c = StrIterPeek(&si);
if (c != '}') {
LOG_ERROR("Expected end of object '}' but found '{c}'", c);
return saved_si;
}
- In
JSON.c:99:
// starting of an object
if (StrIterPeek(&si) != '[') {
LOG_ERROR("Invalid array start. Expected '['.");
return saved_si;
}
- In
JSON.c:112:
if (expect_comma) {
if (StrIterPeek(&si) != ',') {
LOG_ERROR("Expected ',' between values in array. Invalid JSON array.");
return saved_si;
}
- In
JSON.c:124:
// if no advancement in read position
if (read_si.pos == si.pos) {
LOG_ERROR("Failed to parse value. Invalid JSON.");
return saved_si;
}
- In
JSON.c:137:
// end of array
if (StrIterPeek(&si) != ']') {
LOG_ERROR("Invalid end of array. Expected ']'.");
return saved_si;
}
- In
JSON.c:172:
if (!str) {
LOG_ERROR("Invalid str object to read into.");
return si;
}
- In
JSON.c:199:
StrIterNext(&si);
if (!StrIterRemainingLength(&si)) {
LOG_ERROR("Unexpected end of string.");
StrClear(str);
return saved_si;
- In
JSON.c:248:
// espaced unicode sequence
case 'u' :
LOG_ERROR(
"No unicode support '{.6}'. Unicode sequence will be skipped.",
LVAL(si.data + si.pos - 1)
- In
JSON.c:256:
default :
LOG_ERROR("Invalid JSON object key string.");
StrClear(str);
return saved_si;
- In
JSON.c:280:
if (!num) {
LOG_ERROR("Invalid number object.");
return si;
}
- In
JSON.c:304:
case 'e' :
if (has_exp) {
LOG_ERROR("Invalid number. Multiple exponent indicators.");
StrDeinit(&ns);
return saved_si;
- In
JSON.c:316:
case '.' :
if (is_flt) {
LOG_ERROR("Invalid number. Multiple decimal indicators.");
StrDeinit(&ns);
return saved_si;
- In
JSON.c:343:
// +/- can only appear after an exponent
if (!has_exp) {
LOG_ERROR(
"Invalid number. Exponent sign indicators '+' or '-' "
"must appear after exponent 'E' or 'e' indicator."
- In
JSON.c:351:
}
if (has_exp_plus_minus) {
LOG_ERROR(
"Invalid number. Multiple '+' or '-' in Number. "
"Expected only once after 'e' or 'E'."
- In
JSON.c:370:
if (!ns.length) {
LOG_ERROR("Failed to parse number. '{.8}'", LVAL(saved_si.data + saved_si.pos));
StrDeinit(&ns);
return saved_si;
- In
JSON.c:383:
}
if (end == ns.data) {
LOG_ERROR("Failed to convert string to number.");
StrDeinit(&ns);
return saved_si;
- In
JSON.c:408:
if (!val) {
LOG_ERROR("Invalid pointer to integer. Don't know where to store.");
return si;
}
- In
JSON.c:417:
if (si.pos == saved_si.pos) {
LOG_ERROR("Failed to parse integer number.");
return saved_si;
}
- In
JSON.c:422:
if (num.is_float) {
LOG_ERROR("Failed to parse integer. Got floating point value.");
return saved_si;
}
- In
JSON.c:437:
if (!val) {
LOG_ERROR("Invalid pointer to float. Don't know where to store.");
return si;
}
- In
JSON.c:446:
if (si.pos == saved_si.pos) {
LOG_ERROR("Failed to parse floating point number");
return saved_si;
}
- In
JSON.c:465:
if (!b) {
LOG_ERROR("Invalid boolean pointer. Don't know where to store.");
return si;
}
- In
JSON.c:480:
return si;
}
LOG_ERROR("Failed to read boolean value. Expected true. Invalid JSON");
return saved_si;
}
- In
JSON.c:492:
return si;
}
LOG_ERROR("Failed to read boolean value. Expected false. Invalid JSON");
return saved_si;
}
- In
JSON.c:497:
}
LOG_ERROR("Failed to parse boolean value. Expected true/false. Invalid JSON");
return saved_si;
} else {
- In
JSON.c:500:
return saved_si;
} else {
LOG_ERROR(
"Insufficient string length to parse a boolean value. Unexpected "
"end of input."
- In
JSON.c:514:
if (!is_null) {
LOG_ERROR("Invalid boolean pointer. Don't know where to store.");
return si;
}
- In
JSON.c:530:
return si;
}
LOG_ERROR("Failed to read boolean value. Expected null. Invalid JSON");
return saved_si;
}
- In
JSON.c:536:
return saved_si;
} else {
LOG_ERROR(
"Insufficient string length to parse a boolean value. Unexpected "
"end of input."
- In
JSON.c:559:
if (si.pos == before_si.pos) {
LOG_ERROR(
"Failed to read boolean value. Expected true/false. Invalid "
"JSON."
- In
JSON.c:576:
if (si.pos == before_si.pos) {
LOG_ERROR(
"Failed to read boolean value. Expected true/false. Invalid "
"JSON."
- In
JSON.c:595:
if (si.pos == before_si.pos) {
LOG_ERROR("Failed to read string value. Expected string. Invalid JSON.");
return saved_si;
}
- In
JSON.c:609:
if (si.pos == before_si.pos) {
LOG_ERROR("Failed to read number value. Expected a number. Invalid JSON.");
return saved_si;
}
- In
JSON.c:622:
if (si.pos == before_si.pos) {
LOG_ERROR("Failed to read object. Expected an object. Invalid JSON.");
return saved_si;
}
- In
JSON.c:635:
if (si.pos == before_si.pos) {
LOG_ERROR("Failed to read array. Expected an array. Invalid JSON.");
return saved_si;
}
- In
JSON.c:642:
}
LOG_ERROR("Failed to read value. Invalid JSON");
return si;
}
- In
Io.c:192:
default :
LOG_ERROR("Invalid format specifier");
return false;
}
- In
Io.c:199:
if (pos < len) {
LOG_ERROR(
"Parsing format specifier ended, but more characters are left for parsing. Indicates invalid format "
"specifier."
- In
Io.c:271:
// Error if no closing brace found
if (brace_end >= fmt_len) {
LOG_ERROR("Unclosed format specifier");
return false;
}
- In
Io.c:289:
// Check if we have enough arguments
if (arg_idx >= argc) {
LOG_ERROR("Not enough arguments for format string");
return false;
}
- In
Io.c:325:
var_width = 8;
} else {
LOG_ERROR(
"Raw data writing can only be used for u8-64, i8-64, f32, f64. Either unsupported format or "
"attempt to write a complex type."
- In
Io.c:333:
if (fmt_info.width > var_width) {
LOG_ERROR(
"Number of raw bytes to be written exceeds variable width. Excess data filled with zeroes."
);
- In
Io.c:358:
}
default : {
LOG_ERROR("Unreachable code reached");
return false;
}
- In
Io.c:385:
}
default : {
LOG_ERROR("Unreachable code reached");
return false;
}
- In
Io.c:404:
continue;
}
LOG_ERROR("Unmatched closing brace");
return false;
} else {
- In
Io.c:413:
// Check if we used all arguments
if (arg_idx < argc) {
LOG_ERROR("Too many arguments for format string");
return false;
}
- In
Io.c:434:
if (rem_p >= 2 && p[0] == '{' && p[1] == '{') {
if (!in || *in != '{') {
LOG_ERROR("Expected '{' in input");
return NULL;
}
- In
Io.c:442:
} else if (rem_p >= 2 && p[0] == '}' && p[1] == '}') {
if (!in || *in != '}') {
LOG_ERROR("Expected '}' in input");
return NULL;
}
- In
Io.c:462:
if (rem_p == 0 || *p != '}') {
LOG_ERROR("Unmatched '{' in format string");
return NULL;
}
- In
Io.c:469:
char spec_buf[32] = {0};
if (spec_len >= sizeof(spec_buf)) {
LOG_ERROR("Format specifier too long");
return NULL;
}
- In
Io.c:474:
if (arg_index >= argc) {
LOG_ERROR("More placeholders than arguments");
return NULL;
}
- In
Io.c:484:
FmtInfo fmt_info = {0};
if (!ParseFormatSpec(spec_buf, spec_len, &fmt_info)) {
LOG_ERROR("Failed to parse format specifier");
return NULL; // Error already logged by ParseFormatSpec
}
- In
Io.c:496:
TypeSpecificIO *io = &argv[arg_index++];
if (!io->reader) {
LOG_ERROR("Missing reader function");
return NULL;
}
- In
Io.c:522:
}
default : {
LOG_ERROR("Invalid raw data read width specified. Must be one of 1, 2, 4 or 8.");
return NULL;
}
- In
Io.c:549:
var_width = 8;
} else {
LOG_ERROR(
"Raw data reading can only be used for u8-64, i8-64, f32, f64. Either unsupported format or "
"attempt to read a complex type."
- In
Io.c:579:
}
default : {
LOG_ERROR("Invalid raw data read width specified. Must be one of 1, 2, 4 or 8.");
return NULL;
}
- In
Io.c:619:
// Check if reading failed
if (!next || next == in) {
LOG_ERROR("Failed to read value for placeholder {}", LVAL(arg_index - 1));
return NULL;
}
- In
Io.c:628:
// Match exact character from format string
if (!in || *in != *p) {
LOG_ERROR(
"Input '{.8}' does not match format string '{.8}'",
LVAL(in ? in : "(null)"),
- In
Io.c:689:
if (!(new_pos = StrReadFmtInternal(buffer.data, fmtstr, argv, argc))) {
if (can_rollback) {
LOG_ERROR("Parse failed, rolling back...");
fsetpos(file, &start_pos);
} else {
- In
Io.c:692:
fsetpos(file, &start_pos);
} else {
LOG_ERROR("Parse failed, and rollback not possible on non-seekable input");
}
}
- In
Io.c:1250:
const char *s = *str;
if (*s != '\\') {
LOG_ERROR("ProcessEscape called on non-escape sequence");
return 0;
}
- In
Io.c:1294:
s++;
if (!isxdigit(s[0]) || !isxdigit(s[1])) {
LOG_ERROR("Invalid hex escape sequence");
return 0;
}
- In
Io.c:1303:
}
default :
LOG_ERROR("Invalid escape sequence '\\{c}'", s[0]);
return 0;
}
- In
Io.c:1325:
// Check for empty input
if (!*i || !r) {
LOG_ERROR("Empty input string");
return i;
}
- In
Io.c:1408:
// If we get here with a quote, the string was unterminated
if (quote) {
LOG_ERROR("Unterminated quoted string");
StrDeinit(s);
return NULL;
- In
Io.c:1595:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse f64: empty input");
return i;
}
- In
Io.c:1669:
// Validate the string is a proper floating point number
if (!IsValidNumericString(&temp, true)) {
LOG_ERROR("Invalid floating point format");
StrDeinit(&temp);
return start;
- In
Io.c:1676:
// Use StrToF64 directly
if (!StrToF64(&temp, v, NULL)) {
LOG_ERROR("Failed to parse f64");
StrDeinit(&temp);
return start;
- In
Io.c:1695:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse u8: empty input");
return i;
}
- In
Io.c:1726:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:1733:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:1741:
u64 val;
if (!StrToU64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse u8");
StrDeinit(&temp);
return start;
- In
Io.c:1748:
// Check for overflow
if (val > UINT8_MAX) {
LOG_ERROR("Value {} exceeds u8 maximum ({})", val, UINT8_MAX);
StrDeinit(&temp);
return start;
- In
Io.c:1776:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse u16: empty input");
return i;
}
- In
Io.c:1801:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:1808:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:1816:
u64 val;
if (!StrToU64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse u16");
StrDeinit(&temp);
return start;
- In
Io.c:1823:
// Check for overflow
if (val > UINT16_MAX) {
LOG_ERROR("Value {} exceeds u16 maximum ({})", val, UINT16_MAX);
StrDeinit(&temp);
return start;
- In
Io.c:1851:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse u32: empty input");
return i;
}
- In
Io.c:1875:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:1882:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:1890:
u64 val;
if (!StrToU64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse u32");
StrDeinit(&temp);
return start;
- In
Io.c:1897:
// Check for overflow
if (val > UINT32_MAX) {
LOG_ERROR("Value {} exceeds u32 maximum ({})", val, UINT32_MAX);
StrDeinit(&temp);
return start;
- In
Io.c:1925:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse u64: empty input");
return i;
}
- In
Io.c:1950:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:1957:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:1964:
// Use base 0 to let strtoul detect the base from prefix
if (!StrToU64(&temp, v, NULL)) {
LOG_ERROR("Failed to parse u64");
StrDeinit(&temp);
return start;
- In
Io.c:1990:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse i8: empty input");
return i;
}
- In
Io.c:2015:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:2022:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:2030:
i64 val;
if (!StrToI64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse i8");
StrDeinit(&temp);
return start;
- In
Io.c:2037:
// Check for overflow/underflow
if (val > INT8_MAX || val < INT8_MIN) {
LOG_ERROR("Value {} outside i8 range ({} to {})", val, INT8_MIN, INT8_MAX);
StrDeinit(&temp);
return start;
- In
Io.c:2065:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse i16: empty input");
return i;
}
- In
Io.c:2090:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:2097:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:2105:
i64 val;
if (!StrToI64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse i16");
StrDeinit(&temp);
return start;
- In
Io.c:2112:
// Check for overflow/underflow
if (val > INT16_MAX || val < INT16_MIN) {
LOG_ERROR("Value {} outside i16 range ({} to {})", val, INT16_MIN, INT16_MAX);
StrDeinit(&temp);
return start;
- In
Io.c:2140:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse i32: empty input");
return i;
}
- In
Io.c:2165:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:2172:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:2180:
i64 val;
if (!StrToI64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse i32");
StrDeinit(&temp);
return start;
- In
Io.c:2187:
// Check for overflow/underflow
if (val > INT32_MAX || val < INT32_MIN) {
LOG_ERROR("Value {} outside i32 range ({} to {})", val, INT32_MIN, INT32_MAX);
StrDeinit(&temp);
return start;
- In
Io.c:2215:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse i64: empty input");
return i;
}
- In
Io.c:2240:
(temp.data[1] == 'x' || temp.data[1] == 'X' || temp.data[1] == 'b' || temp.data[1] == 'B' ||
temp.data[1] == 'o' || temp.data[1] == 'O')) {
LOG_ERROR("Incomplete number format");
StrDeinit(&temp);
return start;
- In
Io.c:2247:
// Validate the string is a proper number
if (!IsValidNumericString(&temp, false)) {
LOG_ERROR("Invalid numeric format");
StrDeinit(&temp);
return start;
- In
Io.c:2254:
// Use base 0 to let strtoul detect the base from prefix
if (!StrToI64(&temp, v, NULL)) {
LOG_ERROR("Failed to parse i64");
StrDeinit(&temp);
return start;
- In
Io.c:2282:
char *result = malloc(temp.length + 1);
if (!result) {
LOG_ERROR("Failed to allocate memory for string");
StrDeinit(&temp);
return i;
- In
Io.c:2366:
// Check for empty input
if (!*i) {
LOG_ERROR("Empty input string");
return i;
}
- In
Io.c:2384:
if (i == hex_start) {
LOG_ERROR("Invalid hex format - no digits after 0x");
return start;
}
- In
Io.c:2393:
StrParseConfig config = {.base = 16};
if (!StrToU64(&hex_str, &value, &config)) {
LOG_ERROR("Failed to parse hex value");
StrDeinit(&hex_str);
return start;
- In
Io.c:2420:
if (i == oct_start) {
LOG_ERROR("Invalid octal format - no digits after 0o");
return start;
}
- In
Io.c:2429:
StrParseConfig config = {.base = 8};
if (!StrToU64(&oct_str, &value, &config)) {
LOG_ERROR("Failed to parse octal value");
StrDeinit(&oct_str);
return start;
- In
Io.c:2453:
if (i == bin_start) {
LOG_ERROR("Invalid binary format - expected 0s and 1s");
return start;
}
- In
Io.c:2492:
// Check for empty string
if (!*i) {
LOG_ERROR("Failed to parse f32: empty input");
return i;
}
- In
Io.c:2568:
// Validate the string is a proper floating point number
if (!IsValidNumericString(&temp, true)) {
LOG_ERROR("Invalid floating point format");
StrDeinit(&temp);
return start;
- In
Io.c:2576:
f64 val;
if (!StrToF64(&temp, &val, NULL)) {
LOG_ERROR("Failed to parse f32");
StrDeinit(&temp);
return start;
- In
Log.c:41:
StrInitStack(syserr, SYS_ERROR_STR_MAX_LENGTH, {
SysStrError(errno, &syserr);
LOG_ERROR("Failed to get localtime : {}", syserr);
});
LOG_SYS_ERROR("Failed to get localtime");
- In
File.c:17:
bool ReadCompleteFile(const char *filename, char **data, u64 *file_size, u64 *capacity) {
if (!filename || !data || !file_size || !capacity) {
LOG_ERROR("invalid arguments.");
return false;
}
- In
File.c:24:
i64 fsize = SysGetFileSize(filename);
if (-1 == fsize) {
LOG_ERROR("failed to get file size");
return false;
}
- In
Str.c:52:
size n = vsnprintf(NULL, 0, fmt, args);
if (!n) {
LOG_ERROR("invalid size of final string.");
return NULL;
}
- In
Str.c:337:
if (!is_valid_base(config->base)) {
LOG_ERROR("Invalid base: {}", config->base);
return NULL;
}
- In
Str.c:384:
if (!is_valid_base(config->base)) {
LOG_ERROR("Invalid base: {}", config->base);
return NULL;
}
- In
Str.c:418:
if (config->precision > 17) {
LOG_ERROR("Precision {} exceeds maximum (17)", config->precision);
return NULL;
}
- In
Str.c:572:
if (!value) {
LOG_ERROR("NULL output pointer");
return false;
}
- In
Str.c:582:
u8 base = config->base;
if (base != 0 && !is_valid_base(base)) {
LOG_ERROR("Invalid base: {}", base);
return false;
}
- In
Str.c:592:
if (pos >= str->length) {
LOG_ERROR("Empty string");
return false;
}
- In
Str.c:625:
if (IS_SPACE(str->data[pos]))
break;
LOG_ERROR("Invalid digit for base {}: {c}", base, str->data[pos]);
return false;
}
- In
Str.c:631:
// Check overflow
if (result > (UINT64_MAX - digit) / base) {
LOG_ERROR("Overflow");
return false;
}
- In
Str.c:645:
if (config->strict && pos < str->length) {
LOG_ERROR("Extra characters after number");
return false;
}
- In
Str.c:650:
if (!have_digits) {
LOG_ERROR("No valid digits found");
return false;
}
- In
Str.c:662:
if (!value) {
LOG_ERROR("NULL output pointer");
return false;
}
- In
Str.c:676:
if (pos >= str->length) {
LOG_ERROR("Empty string");
return false;
}
- In
Str.c:703:
if (negative) {
if (unsigned_value > 9223372036854775808ULL) {
LOG_ERROR("Overflow");
return false;
}
- In
Str.c:709:
} else {
if (unsigned_value > 9223372036854775807ULL) {
LOG_ERROR("Overflow");
return false;
}
- In
Str.c:722:
if (!value) {
LOG_ERROR("NULL output pointer");
return false;
}
- In
Str.c:736:
if (pos >= str->length) {
LOG_ERROR("Empty string");
return false;
}
- In
Str.c:831:
if (!have_exp_digits) {
LOG_ERROR("Missing exponent digits");
return false;
}
- In
Str.c:845:
if (config->strict && pos < str->length) {
LOG_ERROR("Extra characters after number");
return false;
}
- In
Str.c:850:
if (!have_digits) {
LOG_ERROR("No valid digits found");
return false;
}
- In
List.c:6:
void deinit_list(GenericList *list, u64 item_size) {
if (!list || !item_size) {
LOG_ERROR("invalid arguments");
return;
}
- In
Proc.c:587:
DWORD len = GetModuleFileNameA(NULL, buffer, MAX_PATH);
if (len == 0 || len >= MAX_PATH) {
LOG_ERROR("Failed to get executable path or buffer too small");
return NULL;
}
if (iteration_count > 2) {
LOG_ERROR("Should've terminated");
VecDeinit(&vec);
return false;
if (idx > 2) {
LOG_ERROR("Should've terminated");
VecDeinit(&vec);
return false;
if (idx < 4) {
LOG_ERROR("Should've terminated");
VecDeinit(&vec);
return false;
if (idx > 3) {
LOG_ERROR("Should've terminated");
VecDeinit(&vec);
return false;
if (idx < 5) {
LOG_ERROR("Should've terminated");
VecDeinit(&vec);
return false;
if (idx > vec.length) {
LOG_ERROR("Should've terminated");
VecDeinit(&vec);
return false;
if (idx > 2) {
LOG_ERROR("Should've terminated");
VecDeinit(&vec);
return false;
if (idx > 4) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
return false;
if (idx >= 5) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
return false;
// loop will automatically terminate
if (idx < 10) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
return false;
if (idx > 4) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
return false;
if (idx < 12) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
return false;
if (idx >= s.length) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
return false;
if (idx > 3) {
LOG_ERROR("Should've terminated");
StrDeinit(&s);
return false;
- In
ElfInfo.c:341:
FILE *elf = fopen(argv[1], "rb");
if (!elf) {
LOG_ERROR("Failed to open file for reading.");
return 1;
}
- In
MisraEnum.c:85:
if (!e.name.length) {
LOG_ERROR("Invalid enum entry in 'entries' array. Entry without name.");
abort();
}
- In
MisraEnum.c:96:
if (to_from_str && !e.str.length) {
LOG_ERROR("to_from_str is set to true but str value not provided for enum {}", e.name);
abort();
}
- In
MisraEnum.c:140:
"{} {}FromZstr(const char* zstr) {{\n"
" if(!zstr) {{\n"
" LOG_ERROR(\"Invalid string provided. Cannot convert to enum.\");\n"
" return {};\n"
" }}\n";
- In
MisraDoc.c:29:
void ProjectDeinit(Project *p) {
if (!p) {
LOG_ERROR("Invalid project object. Invalid arguments");
abort();
}
- In
MisraDoc.c:169:
Scope(&file_contents, StrDeinit, {
if (!ReadCompleteFile(file_path.data, &file_contents.data, &file_contents.length, &file_contents.capacity)) {
LOG_ERROR("Failed to read \"{}\" source file.", file_path.data);
continue;
}
- In
Main.c:24:
VecDeinit(&file);
} else {
LOG_ERROR("Failed to read file");
}
return 0;
- In
JSON.h:417:
/* starting of an object */ \
if (StrIterPeek(&si) != '[') { \
LOG_ERROR("Invalid array start. Expected '['."); \
si = saved_si; \
break; \
- In
JSON.h:431:
if (expect_comma) { \
if (StrIterPeek(&si) != ',') { \
LOG_ERROR("Expected ',' between values in array. Invalid JSON array."); \
failed = true; \
si = saved_si; \
- In
JSON.h:451:
/* if still no advancement in read position */ \
if (read_si.pos == si.pos) { \
LOG_ERROR("Failed to parse value. Invalid JSON."); \
StrDeinit(&key); \
failed = true; \
- In
JSON.h:468:
if (!failed) { \
if (StrIterPeek(&si) != ']') { \
LOG_ERROR("Invalid end of array. Expected ']'."); \
failed = true; \
si = saved_si; \
- In
JSON.h:509:
/* starting of an object */ \
if (StrIterPeek(&si) != '{') { \
LOG_ERROR("Invalid object start. Expected '{'."); \
si = saved_si; \
break; \
- In
JSON.h:524:
if (expect_comma) { \
if (StrIterPeek(&si) != ',') { \
LOG_ERROR("Expected ',' after key/value pairs in object. Invalid JSON object."); \
failed = true; \
si = saved_si; \
- In
JSON.h:539:
read_si = JReadString(si, &key); \
if (read_si.pos == si.pos) { \
LOG_ERROR("Failed to read string key in object. Invalid JSON"); \
StrDeinit(&key); \
failed = true; \
- In
JSON.h:551:
\
if (StrIterPeek(&si) != ':') { \
LOG_ERROR("Expected ':' after key string. Failed to read JSON"); \
StrDeinit(&key); \
failed = true; \
- In
JSON.h:573:
/* if still no advancement in read position */ \
if (read_si.pos == si.pos) { \
LOG_ERROR("Failed to parse value. Invalid JSON."); \
StrDeinit(&key); \
failed = true; \
- In
JSON.h:594:
char c = StrIterPeek(&si); \
if (c != '}') { \
LOG_ERROR("Expected end of object '}' but found '{c}'", c); \
failed = true; \
si = saved_si; \