Message ID | 20250317150641362EJeegz3uSr3jw0hqok9Mm@zte.com.cn (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | kconfig: Replace deprecated strncpy() with strscpy() | expand |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index ac95661a1c9d..712ed0602292 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -99,8 +99,7 @@ static int make_parent_dir(const char *path) char tmp[PATH_MAX + 1]; char *p; - strncpy(tmp, path, sizeof(tmp)); - tmp[sizeof(tmp) - 1] = 0; + strscpy(tmp, path, sizeof(tmp)); /* Remove the base name. Just return if nothing is left */ p = strrchr(tmp, '/');