mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-03 22:56:33 +02:00
common: New function map_static_strings
* common/mapstrings.c (struct intmapping_s): New. (map_static_strings): New. * common/stringhelp.c (do_strconcat): Rename to ... (vstrconcat): this and make global. * common/t-mapstrings.c (test_map_static_strings): New test.
This commit is contained in:
parent
8631d4cfe2
commit
449d2fbcde
4 changed files with 86 additions and 5 deletions
|
@ -1169,9 +1169,10 @@ try_percent_escape (const char *str, const char *extra)
|
|||
}
|
||||
|
||||
|
||||
|
||||
static char *
|
||||
do_strconcat (const char *s1, va_list arg_ptr)
|
||||
/* Same as strconcat but takes a va_list. Returns EINVAL if the list
|
||||
* is too long, all other errors are due to an ENOMEM condition. */
|
||||
char *
|
||||
vstrconcat (const char *s1, va_list arg_ptr)
|
||||
{
|
||||
const char *argv[48];
|
||||
size_t argc;
|
||||
|
@ -1216,7 +1217,7 @@ strconcat (const char *s1, ...)
|
|||
else
|
||||
{
|
||||
va_start (arg_ptr, s1);
|
||||
result = do_strconcat (s1, arg_ptr);
|
||||
result = vstrconcat (s1, arg_ptr);
|
||||
va_end (arg_ptr);
|
||||
}
|
||||
return result;
|
||||
|
@ -1235,7 +1236,7 @@ xstrconcat (const char *s1, ...)
|
|||
else
|
||||
{
|
||||
va_start (arg_ptr, s1);
|
||||
result = do_strconcat (s1, arg_ptr);
|
||||
result = vstrconcat (s1, arg_ptr);
|
||||
va_end (arg_ptr);
|
||||
}
|
||||
if (!result)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue