summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-08-09 05:47:53 -0400
committermidipix <writeonce@midipix.org>2018-08-09 05:47:53 -0400
commit598944c893f8eec1680890353ae32f9d52bc4ffd (patch)
treebcb418b61e5d2b5ce8753888d4c0dece2d7d7868 /src
parente3d183ade43803d9eb8174bbabd3ca4f384e443a (diff)
downloadptycon-598944c893f8eec1680890353ae32f9d52bc4ffd.tar.bz2
ptycon-598944c893f8eec1680890353ae32f9d52bc4ffd.tar.xz
front-end utility: ptyc_main(): remove the redundant argc parameter.
Diffstat (limited to 'src')
-rw-r--r--src/driver/ptyc_amain.c6
-rw-r--r--src/ptycon.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/src/driver/ptyc_amain.c b/src/driver/ptyc_amain.c
index 1021048..37c2657 100644
--- a/src/driver/ptyc_amain.c
+++ b/src/driver/ptyc_amain.c
@@ -56,7 +56,7 @@ static int ptyc_exit(struct ptyc_driver_ctx * dctx, int nerrors)
return nerrors ? 2 : 0;
}
-int ptyc_main(int argc, char ** argv, char ** envp)
+int ptyc_main(char ** argv, char ** envp)
{
int ret;
struct ptyc_driver_ctx * dctx;
@@ -65,7 +65,9 @@ int ptyc_main(int argc, char ** argv, char ** envp)
return ret;
if ((ret = ptyc_get_driver_ctx(argv,envp,PTYC_DRIVER_FLAGS,&dctx)))
- return (ret == PTYC_USAGE) ? !--argc : 2;
+ return (ret == PTYC_USAGE)
+ ? !argv || !argv[0] || !argv[1]
+ : 2;
if (dctx->cctx->drvflags & PTYC_DRIVER_VERSION)
if ((ptyc_version(dctx)) < 0)
diff --git a/src/ptycon.c b/src/ptycon.c
index 000b333..1b5bf7f 100644
--- a/src/ptycon.c
+++ b/src/ptycon.c
@@ -36,7 +36,7 @@ static int ptycon_dbg_init(char ** argv)
return 0;
}
-static int32_t ptycon_start(int argc, char ** argv, char ** envp)
+static int32_t ptycon_start(char ** argv, char ** envp)
{
int32_t status;
nt_runtime_data * rtdata;
@@ -49,7 +49,6 @@ static int32_t ptycon_start(int argc, char ** argv, char ** envp)
return status;
if (rtdata->argv) {
- argc = rtdata->argc;
argv = rtdata->argv;
envp = rtdata->envp;
}
@@ -67,7 +66,7 @@ static int32_t ptycon_start(int argc, char ** argv, char ** envp)
/* no tty session? */
if (!rtdata->tty_keys[0])
- return ptyc_main(argc,argv,envp);
+ return ptyc_main(argv,envp);
/* tty */
ntapi->tt_aligned_block_memset(
@@ -119,7 +118,7 @@ static int32_t ptycon_start(int argc, char ** argv, char ** envp)
return status;
/* main */
- return ptyc_main(argc,argv,envp);
+ return ptyc_main(argv,envp);
}
static int __stdcall ptycon_daemon_entry_point(void * hswap)
@@ -137,8 +136,7 @@ static int __stdcall ptycon_daemon_entry_point(void * hswap)
0,0,0)))
ptycon_exit(status);
- ptycon_exit(ptycon_start(
- argc,argv,envp));
+ ptycon_exit(ptycon_start(argv,envp));
return NT_STATUS_INTERNAL_ERROR;
}