1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-08-05 20:55:46 +03:00

examples: Fix sparse warnings in sshd examples.

This commit is contained in:
Andreas Schneider
2012-02-18 12:35:16 +01:00
parent 2ca0a9cdb2
commit 387d9e4855
2 changed files with 12 additions and 14 deletions

View File

@@ -36,8 +36,8 @@ clients must be made or how a client should react.
#endif #endif
#ifdef WITH_PCAP #ifdef WITH_PCAP
const char *pcap_file="debug.server.pcap"; static const char *pcap_file = "debug.server.pcap";
ssh_pcap_file pcap; static ssh_pcap_file pcap;
static void set_pcap(ssh_session session){ static void set_pcap(ssh_session session){
if(!pcap_file) if(!pcap_file)
@@ -52,7 +52,7 @@ static void set_pcap(ssh_session session){
ssh_set_pcap_file(session,pcap); ssh_set_pcap_file(session,pcap);
} }
static void cleanup_pcap(){ static void cleanup_pcap(void) {
ssh_pcap_file_free(pcap); ssh_pcap_file_free(pcap);
pcap=NULL; pcap=NULL;
} }
@@ -172,10 +172,10 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) {
static struct argp argp = {options, parse_opt, args_doc, doc, NULL, NULL, NULL}; static struct argp argp = {options, parse_opt, args_doc, doc, NULL, NULL, NULL};
#endif /* HAVE_ARGP_H */ #endif /* HAVE_ARGP_H */
const char *name; static const char *name;
const char *instruction; static const char *instruction;
const char *prompts[2]; static const char *prompts[2];
char echo[] = { 1, 0 }; static char echo[] = { 1, 0 };
static int kbdint_check_response(ssh_session session) { static int kbdint_check_response(ssh_session session) {
int count; int count;

View File

@@ -33,11 +33,10 @@ clients must be made or how a client should react.
#endif #endif
#ifdef WITH_PCAP #ifdef WITH_PCAP
const char *pcap_file="debug.server.pcap"; static const char *pcap_file="debug.server.pcap";
ssh_pcap_file pcap; static ssh_pcap_file pcap;
void set_pcap(ssh_session session); static void set_pcap(ssh_session session) {
void set_pcap(ssh_session session){
if(!pcap_file) if(!pcap_file)
return; return;
pcap=ssh_pcap_file_new(); pcap=ssh_pcap_file_new();
@@ -50,8 +49,7 @@ void set_pcap(ssh_session session){
ssh_set_pcap_file(session,pcap); ssh_set_pcap_file(session,pcap);
} }
void cleanup_pcap(void); static void cleanup_pcap(void) {
void cleanup_pcap(){
ssh_pcap_file_free(pcap); ssh_pcap_file_free(pcap);
pcap=NULL; pcap=NULL;
} }
@@ -118,7 +116,7 @@ static struct argp_option options[] = {
.doc = "Get verbose output.", .doc = "Get verbose output.",
.group = 0 .group = 0
}, },
{NULL, 0, 0, 0, NULL, 0} {NULL, 0, NULL, 0, NULL, 0}
}; };
/* Parse a single option. */ /* Parse a single option. */