aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/util.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-11-12 21:16:45 +0100
committeremersion <contact@emersion.fr>2017-11-12 21:16:45 +0100
commit28fc813ca9853147efc7915b829dd435699e9434 (patch)
treecd48a2043b489f8c6d3f38fe91a3c6d1a2f32e66 /backend/drm/util.c
parent5d986f1e874f93f8235fbcc333af63c5c9c99596 (diff)
parentc1eff3d3afc237aa4a988a01c88c492a4787d954 (diff)
Merge branch 'master' into cursor-scale
Diffstat (limited to 'backend/drm/util.c')
-rw-r--r--backend/drm/util.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/backend/drm/util.c b/backend/drm/util.c
index 656c070a..c27d7b67 100644
--- a/backend/drm/util.c
+++ b/backend/drm/util.c
@@ -106,8 +106,15 @@ void parse_edid(struct wlr_output *restrict output, size_t len, const uint8_t *d
if (nl) {
*nl = '\0';
}
+ } else if (flag == 0 && data[i + 3] == 0xFF) {
+ sprintf(output->serial, "%.13s", &data[i + 5]);
- break;
+ // Monitor serial numbers are terminated by newline if they're too
+ // short
+ char *nl = strchr(output->serial, '\n');
+ if (nl) {
+ *nl = '\0';
+ }
}
}
}