Page MenuHomeFreeBSD

D31005.diff
No OneTemporary

D31005.diff

diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h
--- a/sys/compat/linuxkpi/common/include/linux/string.h
+++ b/sys/compat/linuxkpi/common/include/linux/string.h
@@ -167,4 +167,20 @@
return (strncmp(str, prefix, len) == 0 ? len : 0);
}
+static inline ssize_t
+strscpy(char* dst, const char* src, size_t len)
+{
+ size_t i;
+
+ if (len <= INT_MAX) {
+ for (i = 0; i < len; i++)
+ if ('\0' == (dst[i] = src[i]))
+ return ((ssize_t)i);
+ if (i != 0)
+ dst[--i] = '\0';
+ }
+
+ return (-E2BIG);
+}
+
#endif /* _LINUX_STRING_H_ */

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 7:25 PM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14683705
Default Alt Text
D31005.diff (611 B)

Event Timeline