aboutsummaryrefslogtreecommitdiffstats
path: root/agent/genkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'agent/genkey.c')
-rw-r--r--agent/genkey.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/agent/genkey.c b/agent/genkey.c
index d86296390..9e2f32480 100644
--- a/agent/genkey.c
+++ b/agent/genkey.c
@@ -117,7 +117,8 @@ check_passphrase_pattern (ctrl_t ctrl, const char *pw)
fclose (infp);
return 1; /* Error - assume password should not be used. */
}
- rewind (infp);
+ fseek (infp, 0, SEEK_SET);
+ clearerr (infp);
i = 0;
argv[i++] = "--null";
@@ -134,7 +135,8 @@ check_passphrase_pattern (ctrl_t ctrl, const char *pw)
result = 0; /* Success; i.e. no match. */
/* Overwrite our temporary file. */
- rewind (infp);
+ fseek (infp, 0, SEEK_SET);
+ clearerr (infp);
for (i=((strlen (pw)+99)/100)*100; i > 0; i--)
putc ('\xff', infp);
fflush (infp);