aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/xen/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'xen/include/xen/string.h')
-rw-r--r--xen/include/xen/string.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/xen/include/xen/string.h b/xen/include/xen/string.h
index 384ee2cfce..0c6dd612ad 100644
--- a/xen/include/xen/string.h
+++ b/xen/include/xen/string.h
@@ -81,4 +81,9 @@ extern void * memchr(const void *,int,__kernel_size_t);
}
#endif
+#define safe_strcpy(d,s) \
+do { strncpy((d),(s),sizeof((d))); \
+ (d)[sizeof((d))-1] = '\0'; \
+} while (0)
+
#endif /* _LINUX_STRING_H_ */