Fix improper termination of samterm argv. - sam - An updated version of the sam text editor.
(HTM) git clone git://vernunftzentrum.de/sam.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 95e5651ac21d62d392536e2cfe1784c69ac30766
(DIR) parent faf04a03721d852086ec2c89ff28c0a94d583f01
(HTM) Author: Rob King <jking@deadpixi.com>
Date: Wed, 18 May 2016 16:13:43 -0500
Fix improper termination of samterm argv.
Diffstat:
sam/sam.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/sam/sam.c b/sam/sam.c
@@ -43,7 +43,8 @@ int main(int argc, char *argv[])
int targc = 1;
ap = &arg[argc];
- arg[argc] = NULL;
+ arg[0] = "samterm";
+
while ((o = getopt(argc, argv, "edRr:t:s:")) != -1){
switch (o){
case 'e':
@@ -78,6 +79,7 @@ int main(int argc, char *argv[])
}
argv += optind;
argc -= optind;
+ arg[targc] = NULL;
Strinit(&cmdstr);
Strinit0(&lastpat);