Displaying 3 results from an estimated 3 matches for "xstrncpy".
Did you mean:
strncpy
2019 Nov 05
0
[klibc:master] losetup: Fix char signedness mismatches with <linux/loop.h>
...const char *e = (const char *)loopinfo64.lo_crypt_name;
if (*e == 0 && loopinfo64.lo_encrypt_type == 1)
e = "XOR";
@@ -258,14 +258,14 @@ int set_loop(const char *device, const char *file, unsigned long long offset,
memset(&loopinfo64, 0, sizeof(loopinfo64));
- xstrncpy(loopinfo64.lo_file_name, file, LO_NAME_SIZE);
+ xstrncpy((char *)loopinfo64.lo_file_name, file, LO_NAME_SIZE);
if (encryption && *encryption) {
if (digits_only(encryption)) {
loopinfo64.lo_encrypt_type = atoi(encryption);
} else {
loopinfo64.lo_encrypt_type = LO_CRYPT_CRYP...
2010 Mar 14
0
[patches] klibc review unsorted patch queue
.../sysmacros.h>
+#include <string.h>
+
+#include "loop.h"
+
+extern int verbose;
+extern char *progname;
+extern char *xstrdup (const char *s); /* not: #include "sundries.h" */
+extern void error (const char *fmt, ...); /* idem */
+
+/* caller guarantees n > 0 */
+void xstrncpy(char *dest, const char *src, size_t n)
+{
+ strncpy(dest, src, n-1);
+ dest[n-1] = 0;
+}
+
+
+static int loop_info64_to_old(const struct loop_info64 *info64, struct loop_info *info)
+{
+ memset(info, 0, sizeof(*info));
+ info->lo_number = info64->lo_number;
+ info->lo_device = info64->l...
2019 Nov 05
0
[klibc:master] losetup: Delete fallbacks to LOOP_{GET, SET}_STATUS
...---
usr/utils/losetup.c | 65 ++---------------------------------------------------
1 file changed, 2 insertions(+), 63 deletions(-)
diff --git a/usr/utils/losetup.c b/usr/utils/losetup.c
index 1f50a001..5d328138 100644
--- a/usr/utils/losetup.c
+++ b/usr/utils/losetup.c
@@ -33,39 +33,8 @@ void xstrncpy(char *dest, const char *src, size_t n)
}
-static int loop_info64_to_old(const struct loop_info64 *info64, struct loop_info *info)
-{
- memset(info, 0, sizeof(*info));
- info->lo_number = info64->lo_number;
- info->lo_device = info64->lo_device;
- info->lo_inode = info64->lo_i...