printf(_("no label, "));
#ifdef HAVE_LIBUUID
if (ctl->uuid) {
- char uuid_string[37];
+ char uuid_string[UUID_STR_LEN];
uuid_unparse(ctl->uuid, uuid_string);
printf("UUID=%s\n", uuid_string);
} else
struct dos_partition *p0, *p;
unsigned char *data;
uint32_t start, size, id;
- char idstr[37];
+ char idstr[UUID_STR_LEN];
data = blkid_probe_get_sector(pr, 0);
uint64_t offset; /* begin of the partition table (in bytes) */
int nparts; /* number of partitions */
blkid_partition parent; /* parent of nested partition table */
- char id[37]; /* PT identifier (e.g. UUID for GPT) */
+ char id[UUID_STR_LEN]; /* PT identifier (e.g. UUID for GPT) */
struct list_head t_tabs; /* all tables */
};
uint64_t size; /* size of the partitions (512-bytes sectors) */
int type; /* partition type */
- char typestr[37]; /* partition type string (GPT and Mac) */
+ char typestr[UUID_STR_LEN]; /* partition type string (GPT and Mac) */
unsigned long long flags; /* partition flags / attributes */
int partno; /* partition number */
- char uuid[37]; /* UUID (when supported by PT), e.g GPT */
+ char uuid[UUID_STR_LEN]; /* UUID (when supported by PT), e.g GPT */
unsigned char name[128]; /* Partition in UTF8 name (when supported by PT), e.g. Mac */
blkid_parttable tab; /* partition table */
if (!v)
return -ENOMEM;
- v->len = 37;
+ v->len = UUID_STR_LEN;
v->data = calloc(1, v->len);
if (v->data) {
blkid_unparse_uuid(uuid, (char *) v->data, v->len);
#include "blkidP.h"
#include "pt-mbr.h"
+#ifndef UUID_STR_LEN
+#define UUID_STR_LEN 37
+#endif
+
extern int blkid_partitions_get_flags(blkid_probe pr);
extern blkid_parttable blkid_partlist_new_parttable(blkid_partlist ls,
if (!v)
return -ENOMEM;
- v->len = 37;
+ v->len = UUID_STR_LEN;
v->data = calloc(1, v->len);
if (!v->data)
rc = -ENOMEM;
#include "blkidP.h"
+#ifndef UUID_STR_LEN
+#define UUID_STR_LEN 37
+#endif
+
extern const struct blkid_idinfo cramfs_idinfo;
extern const struct blkid_idinfo swap_idinfo;
extern const struct blkid_idinfo swsuspend_idinfo;
#define gpt_partition_start(_e) le64_to_cpu((_e)->lba_start)
#define gpt_partition_end(_e) le64_to_cpu((_e)->lba_end)
+#ifndef UUID_STR_LEN
+#define UUID_STR_LEN 37
+#endif
+
/*
* in-memory fdisk GPT stuff
*/
const struct gpt_entry *e)
{
struct fdisk_parttype *t;
- char str[37];
+ char str[UUID_STR_LEN];
struct gpt_guid guid = e->type;
guid_to_string(&guid, str);
static char *gpt_get_header_id(struct gpt_header *header)
{
- char str[37];
+ char str[UUID_STR_LEN];
struct gpt_guid guid = header->disk_guid;
guid_to_string(&guid, str);
{
struct fdisk_gpt_label *gpt;
struct gpt_entry *e;
- char u_str[37];
+ char u_str[UUID_STR_LEN];
int rc = 0;
struct gpt_guid guid;
e = gpt_get_entry(gpt, n);
if (pa->uuid) {
- char new_u[37], old_u[37];
+ char new_u[UUID_STR_LEN], old_u[UUID_STR_LEN];
struct gpt_guid guid;
guid = e->partition_guid;
{
int rc = 0;
size_t esz = 0;
- char str[37];
+ char str[UUID_STR_LEN];
struct fdisk_gpt_label *gpt;
struct gpt_guid guid;
{
int fd, ret = 0;
size_t sz;
- char str[sizeof("01234567-89ab-cdef-0134-567890abcedf")];
+ char str[UUID_STR_LEN];
uuid_t uuidBits;
if ((fd = open(file, O_RDONLY)) < 0) {
/* parse.c */
extern int uuid_parse(const char *in, uuid_t uu);
+#define UUID_STR_LEN 37
+
/* unparse.c */
extern void uuid_unparse(const uuid_t uu, char *out);
extern void uuid_unparse_lower(const uuid_t uu, char *out);
static void object_dump(size_t idx, object_t *obj)
{
- char uuid_string[37], *p;
+ char uuid_string[UUID_STR_LEN], *p;
p = uuid_string;
object_uuid_to_string(obj, &p);
#include "nls.h"
-/* length of textual representation of UUID, including trailing \0 */
-#define UUID_STR_LEN 37
-
/* length of binary representation of UUID */
#define UUID_LEN (sizeof(uuid_t))
{
int c;
int do_type = 0;
- char str[37];
+ char str[UUID_STR_LEN];
uuid_t uu;
static const struct option longopts[] = {
#define MAX_PAGESIZE (64 * 1024)
+#ifndef UUID_STR_LEN
+#define UUID_STR_LEN 37
+#endif
+
enum {
SIG_SWAPSPACE = 1,
SIG_SWSUSPEND
if (s && *s->uuid) {
const unsigned char *u = s->uuid;
- char str[37];
+ char str[UUID_STR_LEN];
snprintf(str, sizeof(str),
"%02x%02x%02x%02x-"
static void get_template(const char *ns)
{
const uuid_t *uuidptr;
- char buf[37];
+ char buf[UUID_STR_LEN];
uuidptr = uuid_get_template(ns);
if (uuidptr == NULL)