summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-13 10:41:14 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-13 14:18:15 -0800
commitda0bcc8b8746cd3eb93f20d61145edc6a1040dda (patch)
treef7e66be154151fd3b51a566f32690c114912fbc8
parent0ac060079060419bdfc4e54ba1a8643cffa1d7d3 (diff)
Use C99 struct initialization
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xrdb.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/xrdb.c b/xrdb.c
index 17e4d34..aad27d4 100644
--- a/xrdb.c
+++ b/xrdb.c
@@ -400,10 +400,11 @@ static void
GetEntriesString(Entries *entries, char *str)
{
if (str && *str) {
- Buffer buff;
+ Buffer buff = {
+ .buff = str,
+ .used = strlen(str)
+ };
- buff.buff = str;
- buff.used = strlen(str);
GetEntries(entries, &buff, 1);
}
}
@@ -701,15 +702,17 @@ DoScreenDefines(Display *display, int scrno, String *defs)
static Entry *
FindEntry(Entries *db, Buffer *b)
{
- Entries phoney;
- Entry entry;
+ Entry entry = {
+ .usable = False,
+ .tag = NULL,
+ .value = NULL
+ };
+ Entries phoney = {
+ .used = 0,
+ .room = 1,
+ .entry = &entry
+ };
- entry.usable = False;
- entry.tag = NULL;
- entry.value = NULL;
- phoney.used = 0;
- phoney.room = 1;
- phoney.entry = &entry;
GetEntries(&phoney, b, 1);
if (phoney.used < 1)
return NULL;