proper NULL termination;
authorwenzelm
Mon Oct 07 22:02:46 2013 +0200 (2013-10-07 ago)
changeset 543148f7061babae4
parent 54313 da2e6282a4f5
child 54315 782e430e6a83
proper NULL termination;
Admin/Linux/Isabelle.c
     1.1 --- a/Admin/Linux/Isabelle.c	Mon Oct 07 21:24:44 2013 +0200
     1.2 +++ b/Admin/Linux/Isabelle.c	Mon Oct 07 22:02:46 2013 +0200
     1.3 @@ -22,7 +22,7 @@
     1.4    char **cmd_line = NULL;
     1.5    int i = 0;
     1.6  
     1.7 -  cmd_line = malloc(sizeof(char *) * argc);
     1.8 +  cmd_line = malloc(sizeof(char *) * (argc + 1));
     1.9    if (cmd_line == NULL) fail("Failed to allocate command line");
    1.10  
    1.11    cmd_line[0] = malloc(strlen(argv[0]) + 5);
    1.12 @@ -33,6 +33,8 @@
    1.13  
    1.14    for (i = 1; i < argc; i++) cmd_line[i] = argv[i];
    1.15  
    1.16 +  cmd_line[argc] = NULL;
    1.17 +
    1.18    execvp(cmd_line[0], cmd_line);
    1.19    fail("Failed to execute application script");
    1.20  }