{
char *sp = (char *) signature_page;
- strncpy(sp + pagesize - 10, sig, 10);
+ strncpy(sp + pagesize - SWAP_SIGNATURE_SZ, sig, SWAP_SIGNATURE_SZ);
}
static void
printf(_("Setting up swapspace version %d, size = %llu KiB\n"),
version, goodpages * pagesize / 1024);
- write_signature("SWAPSPACE2");
+ write_signature(SWAP_SIGNATURE);
write_uuid_and_label(uuid, opt_label);
offset = 1024;
#define SWAP_VERSION 1
#define SWAP_UUID_LENGTH 16
#define SWAP_LABEL_LENGTH 16
+#define SWAP_SIGNATURE "SWAPSPACE2"
+#define SWAP_SIGNATURE_SZ (sizeof(SWAP_SIGNATURE) - 1)
#include <stdint.h>
SIG_SWSUSPEND
};
-#define SWAP_SIGNATURE "SWAPSPACE2"
-#define SWAP_SIGNATURE_SZ (sizeof(SWAP_SIGNATURE) - 1)
-
static int all;
static int priority = -1; /* non-prioritized swap by default */
static int discard; /* don't send swap discards by default */