mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
(modify_description): Don't increment OUT_LEN during
the second pass.
This commit is contained in:
parent
fce56851f0
commit
84282a9538
2 changed files with 12 additions and 4 deletions
|
@ -179,18 +179,20 @@ modify_description (const char *in, const char *comment, char **result)
|
|||
switch (in[i])
|
||||
{
|
||||
case '%':
|
||||
out_len++;
|
||||
if (out)
|
||||
*out++ = '%';
|
||||
else
|
||||
out_len++;
|
||||
break;
|
||||
|
||||
case 'c': /* Comment. */
|
||||
out_len += comment_length;
|
||||
if (out && comment_length)
|
||||
if (out)
|
||||
{
|
||||
memcpy (out, comment, comment_length);
|
||||
out += comment_length;
|
||||
}
|
||||
else
|
||||
out_len += comment_length;
|
||||
break;
|
||||
|
||||
default: /* Invalid special sequences are ignored. */
|
||||
|
@ -199,9 +201,10 @@ modify_description (const char *in, const char *comment, char **result)
|
|||
}
|
||||
else
|
||||
{
|
||||
out_len++;
|
||||
if (out)
|
||||
*out++ = in[i];
|
||||
else
|
||||
out_len++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue