Browse Source

compatible solution

doc_update_sequoia
Volker Birk 6 years ago
parent
commit
03f5a4d6e1
1 changed files with 8 additions and 12 deletions
  1. +8
    -12
      src/stringpair.c

+ 8
- 12
src/stringpair.c View File

@ -20,19 +20,15 @@ DYNAMIC_API stringpair_t * new_stringpair(const char *key, const char *value)
if (pair == NULL)
goto enomem;
if (key) {
pair->key = strdup(key);
assert(pair->key);
if (pair->key == NULL)
goto enomem;
}
pair->key = key ? strdup(key) : strdup("");
assert(pair->key);
if (pair->key == NULL)
goto enomem;
if (value) {
pair->value = strdup(value);
assert(pair->value);
if (pair->value == NULL)
goto enomem;
}
pair->value = value ? strdup(value) : strdup("");
assert(pair->value);
if (pair->value == NULL)
goto enomem;
return pair;


Loading…
Cancel
Save