diff options
| author | Werner Koch <[email protected]> | 2009-10-19 09:18:46 +0000 |
|---|---|---|
| committer | Werner Koch <[email protected]> | 2009-10-19 09:18:46 +0000 |
| commit | 97be197d31314ce89b91683e6440c4630075296d (patch) | |
| tree | ffe2d357588e22e0b06bdb16574ffca72c0d7412 /jnlib/strlist.c | |
| parent | Removed audit.h cruft which forced us to link against libksba. (diff) | |
| download | gnupg-97be197d31314ce89b91683e6440c4630075296d.tar.gz gnupg-97be197d31314ce89b91683e6440c4630075296d.zip | |
[g13] Add RECIPEINT and CREATE command.
[sm] Chnage --include-certs default
Diffstat (limited to 'jnlib/strlist.c')
| -rw-r--r-- | jnlib/strlist.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/jnlib/strlist.c b/jnlib/strlist.c index d45a1648a..b31e6213a 100644 --- a/jnlib/strlist.c +++ b/jnlib/strlist.c @@ -57,6 +57,25 @@ add_to_strlist( strlist_t *list, const char *string ) } +/* Add STRING to the LIST at the front. This function returns NULL + and sets ERRNO on memory shortage. */ +strlist_t +add_to_strlist_try (strlist_t *list, const char *string) +{ + strlist_t sl; + + sl = jnlib_malloc (sizeof *sl + strlen (string)); + if (sl) + { + sl->flags = 0; + strcpy (sl->d, string); + sl->next = *list; + *list = sl; + } + return sl; +} + + /* Same as add_to_strlist() but if IS_UTF8 is *not* set, a conversion to UTF-8 is done. This function terminates the process on memory shortage. */ |
