mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-08 07:33:53 +01:00
Allow for zero number of dpi values to be set
At least in the DBus API we can't just say "doesn't exist", so let's allow for a zero-sized list. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
committed by
Benjamin Tissoires
parent
3e0c803a37
commit
74a5551a8d
@@ -1131,6 +1131,9 @@ ratbag_resolution_get_dpi_list(struct ratbag_resolution *resolution,
|
||||
|
||||
assert(nres > 0);
|
||||
|
||||
if (resolution->ndpis == 0)
|
||||
return 0;
|
||||
|
||||
memcpy(resolutions, resolution->dpis,
|
||||
sizeof(unsigned int) * min(nres, resolution->ndpis));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user