From deb0e1cf33f66de19d6621e54177faa76017786a Mon Sep 17 00:00:00 2001 From: ben Date: Sat, 20 Jan 2007 14:13:57 +0000 Subject: [PATCH] Don't use C99 mid-block declarations and don't do arithmetic on void *. This helps with compilations on ancient Sun compilers. git-svn-id: svn://svn.tartarus.org/sgt/putty@7126 cda61777-01e9-0310-a592-d414129be87e --- unix/uxmisc.c | 3 ++- unix/uxplink.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/unix/uxmisc.c b/unix/uxmisc.c index dc208637..4c6a7670 100644 --- a/unix/uxmisc.c +++ b/unix/uxmisc.c @@ -140,8 +140,9 @@ FILE *f_open(struct Filename filename, char const *mode, int is_private) if (!is_private) { return fopen(filename.path, mode); } else { + int fd; assert(mode[0] == 'w'); /* is_private is meaningless for read */ - int fd = open(filename.path, O_WRONLY | O_CREAT | O_TRUNC, + fd = open(filename.path, O_WRONLY | O_CREAT | O_TRUNC, 0700); if (fd < 0) return NULL; diff --git a/unix/uxplink.c b/unix/uxplink.c index b4fa6da1..e9c6c9e6 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -432,9 +432,9 @@ int get_userpass_input(prompts_t *p, unsigned char *in, int inlen) /* * Handle data from a local tty in PARMRK format. */ -static void from_tty(void *buf, unsigned len) +static void from_tty(void *vbuf, unsigned len) { - char *p, *q, *end; + char *p, *q, *end, *buf = vbuf; static enum {NORMAL, FF, FF00} state = NORMAL; p = buf; end = buf + len; -- 2.11.0