diff options
author | Werner Koch <[email protected]> | 1998-07-06 10:23:57 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 1998-07-06 10:23:57 +0000 |
commit | a9ec668cbe5b3335f5db0f05b8e9e88e29ada52c (patch) | |
tree | e159c79b615fcdcb65f31ee5d1d0a2b1ba84e9aa /util/strgutil.c | |
parent | partly added creation of OP partial length headers (diff) | |
download | gnupg-a9ec668cbe5b3335f5db0f05b8e9e88e29ada52c.tar.gz gnupg-a9ec668cbe5b3335f5db0f05b8e9e88e29ada52c.zip |
intermediate release
Diffstat (limited to 'util/strgutil.c')
-rw-r--r-- | util/strgutil.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/util/strgutil.c b/util/strgutil.c index c6c8f5a65..d19ba6e54 100644 --- a/util/strgutil.c +++ b/util/strgutil.c @@ -39,7 +39,7 @@ free_strlist( STRLIST sl ) } -void +STRLIST add_to_strlist( STRLIST *list, const char *string ) { STRLIST sl; @@ -48,6 +48,25 @@ add_to_strlist( STRLIST *list, const char *string ) strcpy(sl->d, string); sl->next = *list; *list = sl; + return sl; +} + +STRLIST +append_to_strlist( STRLIST *list, const char *string ) +{ + STRLIST r, sl; + + sl = m_alloc( sizeof *sl + strlen(string)); + strcpy(sl->d, string); + sl->next = NULL; + if( !*list ) + *list = sl; + else { + for( r = *list; r->next; r = r->next ) + ; + r->next = sl; + } + return sl; } |