1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

gpg: Improve error code for file already exists.

* g10/plaintext.c (get_output_file): Fix error code.
This commit is contained in:
Werner Koch 2023-05-24 12:09:47 +02:00
parent 2f872fa68c
commit faf0a97b2e
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 2 additions and 3 deletions

View File

@ -137,8 +137,7 @@ get_output_file (const byte *embedded_name, int embedded_namelen,
if (!tmp || !*tmp)
{
xfree (tmp);
/* FIXME: Below used to be GPG_ERR_CREATE_FILE */
err = gpg_error (GPG_ERR_GENERAL);
err = gpg_error (GPG_ERR_EEXIST);
goto leave;
}
xfree (fname);

View File

@ -1530,7 +1530,7 @@ gpgsm_status_with_err_code (ctrl_t ctrl, int no, const char *text,
{
char buf[30];
sprintf (buf, "%u", (unsigned int)ec);
snprintf (buf, sizeof buf, "%u", (unsigned int)ec);
if (text)
return gpgsm_status2 (ctrl, no, text, buf, NULL);
else