diff options
author | Dominique Martinet <asmadeus@codewreck.org> | 2018-07-12 08:41:03 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-07-12 10:18:19 +0100 |
commit | d6b4ea866b8117c1c4a048e2e2dadf0c83776a84 (patch) | |
tree | 4096ba77e117ec2ddca4ce4abde56082a686e037 /drivers/gpu/drm/i915/intel_tv.c | |
parent | 91045034d53eb37b93a3ddd20f25883d9a40b100 (diff) | |
download | lwn-d6b4ea866b8117c1c4a048e2e2dadf0c83776a84.tar.gz lwn-d6b4ea866b8117c1c4a048e2e2dadf0c83776a84.zip |
drm/i915/tv: fix strncpy truncation warning
Change it to use strlcpy instead
Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180712074103.21571-1-chris@chris-wilson.co.uk
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_tv.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_tv.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index 24dc368fdaa1..b5b04cb892e9 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c @@ -1347,8 +1347,7 @@ intel_tv_get_modes(struct drm_connector *connector) mode_ptr = drm_mode_create(connector->dev); if (!mode_ptr) continue; - strncpy(mode_ptr->name, input->name, DRM_DISPLAY_MODE_LEN); - mode_ptr->name[DRM_DISPLAY_MODE_LEN - 1] = '\0'; + strlcpy(mode_ptr->name, input->name, DRM_DISPLAY_MODE_LEN); mode_ptr->hdisplay = hactive_s; mode_ptr->hsync_start = hactive_s + 1; |