projects/guix·blob python-team · refs

26 lines · 866 B

1From 0483993a64f6d922d71dddd8f7f353d8bc22d1bf Mon Sep 17 00:00:00 2001
2From: Evgeni Golov <[email protected]>
3Date: Sat, 29 Aug 2026 19:30:32 +0200
4Subject: [PATCH] use strscpy instead of strncpy
5
6strncpy was removed in Linux 7.2
7
8Source: https://patch-diff.githubusercontent.com/raw/linux-thinkpad/tp_smapi/pull/81.patch
9Upstream-Status: https://github.com/linux-thinkpad/tp_smapi/pull/81
10---
11 tp_smapi.c | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/tp_smapi.c b/tp_smapi.c
15index 39ac601..cb01212 100644
16--- a/tp_smapi.c
17+++ b/tp_smapi.c
18@@ -669,7 +669,7 @@ static ssize_t show_tp_ec_bat_str(u8 arg0, int offset, int maxlen,
19 ret = read_tp_ec_row(arg0, bat, 0, row);
20 if (ret)
21 return ret;
22- strncpy(buf, (char *)row+offset, maxlen);
23+ strscpy(buf, (char *)row+offset, maxlen);
24 buf[maxlen] = 0;
25 strcat(buf, "\n");
26 return strlen(buf);