mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Removed strdup calls when creating capabilities
This commit is contained in:
parent
6682f243ce
commit
50601d4db3
@ -154,49 +154,49 @@ _caps_by_ver(const char * const ver)
|
|||||||
|
|
||||||
char *category = g_key_file_get_string(cache, ver, "category", NULL);
|
char *category = g_key_file_get_string(cache, ver, "category", NULL);
|
||||||
if (category) {
|
if (category) {
|
||||||
new_caps->category = strdup(category);
|
new_caps->category = category;
|
||||||
} else {
|
} else {
|
||||||
new_caps->category = NULL;
|
new_caps->category = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *type = g_key_file_get_string(cache, ver, "type", NULL);
|
char *type = g_key_file_get_string(cache, ver, "type", NULL);
|
||||||
if (type) {
|
if (type) {
|
||||||
new_caps->type = strdup(type);
|
new_caps->type = type;
|
||||||
} else {
|
} else {
|
||||||
new_caps->type = NULL;
|
new_caps->type = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *name = g_key_file_get_string(cache, ver, "name", NULL);
|
char *name = g_key_file_get_string(cache, ver, "name", NULL);
|
||||||
if (name) {
|
if (name) {
|
||||||
new_caps->name = strdup(name);
|
new_caps->name = name;
|
||||||
} else {
|
} else {
|
||||||
new_caps->name = NULL;
|
new_caps->name = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *software = g_key_file_get_string(cache, ver, "software", NULL);
|
char *software = g_key_file_get_string(cache, ver, "software", NULL);
|
||||||
if (software) {
|
if (software) {
|
||||||
new_caps->software = strdup(software);
|
new_caps->software = software;
|
||||||
} else {
|
} else {
|
||||||
new_caps->software = NULL;
|
new_caps->software = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *software_version = g_key_file_get_string(cache, ver, "software_version", NULL);
|
char *software_version = g_key_file_get_string(cache, ver, "software_version", NULL);
|
||||||
if (software_version) {
|
if (software_version) {
|
||||||
new_caps->software_version = strdup(software_version);
|
new_caps->software_version = software_version;
|
||||||
} else {
|
} else {
|
||||||
new_caps->software_version = NULL;
|
new_caps->software_version = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *os = g_key_file_get_string(cache, ver, "os", NULL);
|
char *os = g_key_file_get_string(cache, ver, "os", NULL);
|
||||||
if (os) {
|
if (os) {
|
||||||
new_caps->os = strdup(os);
|
new_caps->os = os;
|
||||||
} else {
|
} else {
|
||||||
new_caps->os = NULL;
|
new_caps->os = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *os_version = g_key_file_get_string(cache, ver, "os_version", NULL);
|
char *os_version = g_key_file_get_string(cache, ver, "os_version", NULL);
|
||||||
if (os_version) {
|
if (os_version) {
|
||||||
new_caps->os_version = strdup(os_version);
|
new_caps->os_version = os_version;
|
||||||
} else {
|
} else {
|
||||||
new_caps->os_version = NULL;
|
new_caps->os_version = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user