Add prototypes for functions returning pointers and modify how some arrays are defined

Functions not declared before use, are define as returning an int.
Under 64-bit this can result in corrupted pointers being returned.

Also, Visual studio doesn't like it when you use variables to declare
array sizes, static values always work though.
This commit is contained in:
dkulwin 2015-11-04 18:34:13 -06:00
parent c2c272eaf1
commit 25e52cb498
4 changed files with 10 additions and 2 deletions

View File

@ -43,6 +43,8 @@
#include "homedirhelp.h"
char *GetHomeDirFromToken(char *userName, HANDLE token);
uid_t getuid(void)
{
return 0;

View File

@ -146,7 +146,7 @@ ssh_askpass(char *askpass, const char *msg)
int length = 8192;
CHAR command[length];
CHAR command[8192];
char *pass = NULL;

View File

@ -824,6 +824,10 @@ server_loop(pid_t pid, int fdin_arg, int fdout_arg, int fderr_arg)
/* NOTREACHED */
}
#ifdef WIN32_FIXME
Session * session_get(int *);
#endif
static void
collect_children(void)
{

View File

@ -105,6 +105,8 @@
#include "sftp.h"
#ifdef WIN32_FIXME
char *GetHomeDirFromToken(char *userName, HANDLE token);
/*
FIXME: GFPZR: Function stat() may be undeclared.
*/
@ -873,7 +875,7 @@ do_exec_no_pty(Session *s, const char *command)
DWORD size = 256;
char name[size];
char name[256];
GetUserName(name, &size);