pkgsrc/security/gpass/patches/patch-ae
jmmv db61aac254 Fix multiple useless C99isms. Should fix the build with GCC 2.95.
Spotted by latest NetBSD 1.6.2/i386 kristerw@'s bulk build.
2005-01-13 19:48:50 +00:00

55 lines
1.5 KiB
Text

$NetBSD: patch-ae,v 1.1 2005/01/13 19:48:50 jmmv Exp $
--- src/passwordfile.c.orig 2004-06-17 16:31:32.000000000 +0200
+++ src/passwordfile.c
@@ -103,11 +103,12 @@ static int password_file_get_val(encstre
gpointer val,
GError **error)
{
- g_return_val_if_fail(error == NULL || *error == NULL, 0);
-
int r;
+ gchar *str;
- gchar *str = password_file_get_line(es, error);
+ g_return_val_if_fail(error == NULL || *error == NULL, 0);
+
+ str = password_file_get_line(es, error);
if (!str) {
g_assert(error == NULL && *error != NULL);
return 0;
@@ -138,11 +139,12 @@ int password_file_read_entry(encstream *
password_file_entry *entry,
GError **error)
{
- g_return_val_if_fail(error == NULL || *error == NULL, 2);
-
GError *t_error = NULL;
size_t desclen;
int r;
+ gchar *buf;
+
+ g_return_val_if_fail(error == NULL || *error == NULL, 2);
if (error == NULL)
error = &t_error;
@@ -167,7 +169,7 @@ int password_file_read_entry(encstream *
if (*error != NULL)
return 1;
- gchar *buf = g_malloc(desclen);
+ buf = g_malloc(desclen);
r = encstream_read(buf, desclen, es);
if (r < desclen) {
if (encstream_error(es))
@@ -280,8 +282,9 @@ void password_file_create(const gchar *f
GError **error)
{
+ encstream *es;
g_return_if_fail(error == NULL || *error == NULL);
- encstream *es = password_file_openw(filename, password, error);
+ es = password_file_openw(filename, password, error);
password_file_close(es, error);
}