From: Nadav Har'El <n...@scylladb.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

implement __swprintf_chk()

Add this missing function, apparently needed by Boost 1.66 compiled
in fortified mode.

Signed-off-by: Nadav Har'El <n...@scylladb.com>

---
diff --git a/libc/stdio/__vfprintf_chk.c b/libc/stdio/__vfprintf_chk.c
--- a/libc/stdio/__vfprintf_chk.c
+++ b/libc/stdio/__vfprintf_chk.c
@@ -1,6 +1,7 @@
 #include "stdio_impl.h"
 #include <stdlib.h>
 #include <stdarg.h>
+#include <wchar.h>

 /* Used by code compiled on Linux with -D_FORTIFY_SOURCE */

@@ -84,3 +85,16 @@ int __vsprintf_chk (char *s, int flags, size_t slen, const char *format,
     }
     return ret;
 }
+
+int __swprintf_chk(wchar_t *s, size_t n, int flag, size_t slen, const wchar_t *format, ...)
+{
+    if(slen < n) {
+        abort();
+    }
+    va_list args;
+    int ret;
+    va_start(args, format);
+    ret = vswprintf(s, n, format, args);
+    va_end(args);
+    return ret;
+}

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to