1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
From 8dc30022b3a899eae7e323b99b5e4fb79518e216 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Tue, 18 Jun 2019 01:38:53 -0700
Subject: [PATCH] Don't omit second operand to `?` operator
---
libfdisk/src/bsd.c | 2 +-
libfdisk/src/dos.c | 2 +-
libfdisk/src/gpt.c | 2 +-
libfdisk/src/parttype.c | 2 +-
libfdisk/src/sgi.c | 2 +-
libfdisk/src/sun.c | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c
index 313ae5ae0..0883915f6 100644
--- a/libfdisk/src/bsd.c
+++ b/libfdisk/src/bsd.c
@@ -116,7 +116,7 @@ static struct fdisk_parttype *bsd_partition_parttype(
{
struct fdisk_parttype *t
= fdisk_label_get_parttype_from_code(cxt->label, p->p_fstype);
- return t ? : fdisk_new_unknown_parttype(p->p_fstype, NULL);
+ return t ? t : fdisk_new_unknown_parttype(p->p_fstype, NULL);
}
diff --git a/libfdisk/src/dos.c b/libfdisk/src/dos.c
index 4368e5266..a8103ac72 100644
--- a/libfdisk/src/dos.c
+++ b/libfdisk/src/dos.c
@@ -148,7 +148,7 @@ static struct fdisk_parttype *dos_partition_parttype(
{
struct fdisk_parttype *t
= fdisk_label_get_parttype_from_code(cxt->label, p->sys_ind);
- return t ? : fdisk_new_unknown_parttype(p->sys_ind, NULL);
+ return t ? t : fdisk_new_unknown_parttype(p->sys_ind, NULL);
}
/*
diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
index 97b161312..5fd9b4d73 100644
--- a/libfdisk/src/gpt.c
+++ b/libfdisk/src/gpt.c
@@ -262,7 +262,7 @@ static struct fdisk_parttype *gpt_partition_parttype(
guid_to_string(&guid, str);
t = fdisk_label_get_parttype_from_string(cxt->label, str);
- return t ? : fdisk_new_unknown_parttype(0, str);
+ return t ? t : fdisk_new_unknown_parttype(0, str);
}
static void gpt_entry_set_type(struct gpt_entry *e, struct gpt_guid *uuid)
diff --git a/libfdisk/src/parttype.c b/libfdisk/src/parttype.c
index 3a5db9c28..b8d017a1d 100644
--- a/libfdisk/src/parttype.c
+++ b/libfdisk/src/parttype.c
@@ -491,7 +491,7 @@ struct fdisk_parttype *fdisk_label_advparse_parttype(
if (res)
DBG(PARTTYPE, ul_debugobj(res, "returns parsed '%s' [%s] partition type",
- res->name, res->typestr ? : ""));
+ res->name, res->typestr ? res->typestr : ""));
return res;
}
diff --git a/libfdisk/src/sgi.c b/libfdisk/src/sgi.c
index 64adf3454..02fd59650 100644
--- a/libfdisk/src/sgi.c
+++ b/libfdisk/src/sgi.c
@@ -351,7 +351,7 @@ static struct fdisk_parttype *sgi_get_parttype(struct fdisk_context *cxt, size_t
return NULL;
t = fdisk_label_get_parttype_from_code(cxt->label, sgi_get_sysid(cxt, n));
- return t ? : fdisk_new_unknown_parttype(sgi_get_sysid(cxt, n), NULL);
+ return t ? t : fdisk_new_unknown_parttype(sgi_get_sysid(cxt, n), NULL);
}
/* fdisk_get_partition() backend */
diff --git a/libfdisk/src/sun.c b/libfdisk/src/sun.c
index 4c3b1d8cb..7a5c63b5b 100644
--- a/libfdisk/src/sun.c
+++ b/libfdisk/src/sun.c
@@ -827,7 +827,7 @@ static struct fdisk_parttype *sun_get_parttype(
t = fdisk_label_get_parttype_from_code(cxt->label,
be16_to_cpu(sunlabel->vtoc.infos[n].id));
- return t ? : fdisk_new_unknown_parttype(be16_to_cpu(sunlabel->vtoc.infos[n].id), NULL);
+ return t ? t : fdisk_new_unknown_parttype(be16_to_cpu(sunlabel->vtoc.infos[n].id), NULL);
}
--
2.31.1
|