fix(cfg): parser bugs on missing final newline

This commit is contained in:
2025-07-06 23:03:41 +02:00
parent 9af69c2417
commit 2f2a2c2696

View File

@@ -66,7 +66,8 @@ int read_desktop(FILE* fd, void* ctx,
buf_start[eq_idx] = '\0'; // the equal
key = trim_str(key);
char* value = &buf_start[eq_idx + 1];
buf_start[read_size - 1] = '\0'; // the newline
if(buf_start[read_size - 1] == '\n')
buf_start[read_size - 1] = '\0';
value = trim_str(value);
// Callback