aboutsummaryrefslogtreecommitdiff
path: root/Documentation/laptops/freefall.c
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/laptops/freefall.c')
-rw-r--r--Documentation/laptops/freefall.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Documentation/laptops/freefall.c b/Documentation/laptops/freefall.c
index aab2ff09e868..d4173186555c 100644
--- a/Documentation/laptops/freefall.c
+++ b/Documentation/laptops/freefall.c
@@ -34,6 +34,7 @@ static int set_unload_heads_path(char *device)
if (strlen(device) <= 5 || strncmp(device, "/dev/", 5) != 0)
return -EINVAL;
strncpy(devname, device + 5, sizeof(devname) - 1);
+ devname[sizeof(devname) - 1] = '\0';
strncpy(device_path, device, sizeof(device_path) - 1);
snprintf(unload_heads_path, sizeof(unload_heads_path) - 1,