mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
catalog: don't make catalog_entry_lang() clobber output params on failure
A minor fix to bring this in-line with our coding style
This commit is contained in:
parent
faab72d16b
commit
bbe804325e
@ -209,9 +209,15 @@ int catalog_file_lang(const char* filename, char **lang) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int catalog_entry_lang(const char* filename, int line,
|
||||
const char* t, const char* deflang, char **lang) {
|
||||
static int catalog_entry_lang(
|
||||
const char* filename,
|
||||
unsigned line,
|
||||
const char* t,
|
||||
const char* deflang,
|
||||
char **ret) {
|
||||
|
||||
size_t c;
|
||||
char *z;
|
||||
|
||||
c = strlen(t);
|
||||
if (c < 2)
|
||||
@ -233,10 +239,11 @@ static int catalog_entry_lang(const char* filename, int line,
|
||||
filename, line);
|
||||
}
|
||||
|
||||
*lang = strdup(t);
|
||||
if (!*lang)
|
||||
return -ENOMEM;
|
||||
z = strdup(t);
|
||||
if (!z)
|
||||
return -ENOMEM;
|
||||
|
||||
*ret = z;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user