void-packages/srcpkgs/kmod/patches/strndupa.patch
2014-12-26 09:52:39 +01:00

15 lines
359 B
Diff

diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c
index df12433..142e767 100644
--- shared/util.c
+++ shared/util.c
@@ -334,7 +334,9 @@ int mkdir_p(const char *path, int len, mode_t mode)
{
char *start, *end;
- start = strndupa(path, len);
+ start = alloca(len+1);
+ strncpy(start, path, len);
+ start[len] = '\0';
end = start + len;
/*