Skip to content

Commit

Permalink
Use path_from_utf8() on the passed filename.
Browse files Browse the repository at this point in the history
Add const attribute.
  • Loading branch information
Laurent Monin committed Apr 11, 2008
1 parent add11b2 commit 6b819d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/secure_save.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "main.h"
#include "secure_save.h"

#include "ui_fileops.h"

/* ABOUT SECURE SAVE */
/* This code was borrowed from the ELinks project (http://elinks.cz)
Expand Down Expand Up @@ -68,7 +69,7 @@ SecureSaveErrno secsave_errno = SS_ERR_NONE;
/** Open a file for writing in a secure way. @returns a pointer to a
* structure secure_save_info on success, or NULL on failure. */
static SecureSaveInfo *
secure_open_umask(gchar *file_name)
secure_open_umask(const gchar *file_name)
{
struct stat st;
SecureSaveInfo *ssi;
Expand All @@ -83,7 +84,7 @@ secure_open_umask(gchar *file_name)

ssi->secure_save = TRUE;

ssi->file_name = g_strdup(file_name);
ssi->file_name = path_from_utf8(file_name);
if (!ssi->file_name) {
secsave_errno = SS_ERR_OUT_OF_MEM;
goto free_f;
Expand Down Expand Up @@ -187,7 +188,7 @@ secure_open_umask(gchar *file_name)
}

SecureSaveInfo *
secure_open(gchar *file_name)
secure_open(const gchar *file_name)
{
SecureSaveInfo *ssi;
mode_t saved_mask;
Expand Down
2 changes: 1 addition & 1 deletion src/secure_save.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

extern SecureSaveErrno secsave_errno; /**< internal secsave error number */

SecureSaveInfo *secure_open(gchar *);
SecureSaveInfo *secure_open(const gchar *);

gint secure_close(SecureSaveInfo *);

Expand Down

0 comments on commit 6b819d4

Please sign in to comment.