backend: X11 后端函数 detect_monitor_by_randr 中使用 p_strndup 替代 strndu

This commit is contained in:
2026-04-11 06:00:08 +08:00
parent 8a72e671bc
commit 11601c75bd

View File

@@ -218,7 +218,7 @@ static bool detect_monitor_by_randr(const backend_t *backend,
if (name_reply) { if (name_reply) {
char *name = xcb_get_atom_name_name(name_reply); char *name = xcb_get_atom_name_name(name_reply);
int length = xcb_get_atom_name_name_length(name_reply); int length = xcb_get_atom_name_name_length(name_reply);
output->name = strndup(name, length); output->name = p_strndup(name, length);
p_delete(&name_reply); p_delete(&name_reply);
} }
} }