x: handle NULL pointer in x_strerror
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
b652e8b58d
commit
fb24e33d52
3
src/x.c
3
src/x.c
|
@ -434,6 +434,9 @@ void x_print_error(unsigned long serial, uint8_t major, uint16_t minor, uint8_t
|
||||||
* for multiple calls to this function,
|
* for multiple calls to this function,
|
||||||
*/
|
*/
|
||||||
const char *x_strerror(xcb_generic_error_t *e) {
|
const char *x_strerror(xcb_generic_error_t *e) {
|
||||||
|
if (!e) {
|
||||||
|
return "No error";
|
||||||
|
}
|
||||||
return _x_strerror(e->full_sequence, e->major_code, e->minor_code, e->error_code);
|
return _x_strerror(e->full_sequence, e->major_code, e->minor_code, e->error_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue