1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-21 22:28:37 -05:00

Don't use C99 mid-block declarations and don't do arithmetic on void *.

This helps with compilations on ancient Sun compilers.

[originally from svn r7126]
This commit is contained in:
Ben Harris 2007-01-20 14:13:57 +00:00
parent df7775359f
commit 003424de05
2 changed files with 4 additions and 3 deletions

View File

@ -140,8 +140,9 @@ FILE *f_open(struct Filename filename, char const *mode, int is_private)
if (!is_private) { if (!is_private) {
return fopen(filename.path, mode); return fopen(filename.path, mode);
} else { } else {
int fd;
assert(mode[0] == 'w'); /* is_private is meaningless for read */ 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); 0700);
if (fd < 0) if (fd < 0)
return NULL; return NULL;

View File

@ -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. * 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; static enum {NORMAL, FF, FF00} state = NORMAL;
p = buf; end = buf + len; p = buf; end = buf + len;