Explorar o código

Fixed segfault which appears while automated gui creation

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@41496 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert %!s(int64=15) %!d(string=hai) anos
pai
achega
d47ed16dbd
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/gis/parser.c

+ 1 - 1
lib/gis/parser.c

@@ -631,7 +631,7 @@ char *G_recreate_command(void)
 
     opt = &st->first_option;
     while (opt) {
-	if (opt->answer && opt->answers[0]) {
+	if (opt->answer && opt->answers && opt->answers[0]) {
 	    slen = strlen(opt->key) + strlen(opt->answers[0]) + 4;	/* +4 for: ' ' = " " */
 	    if (len + slen >= nalloced) {
 		nalloced += (nalloced + 1024 > len + slen) ? 1024 : slen + 1;