Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


set the default base port of ne2000 to -1 to make it able to coexist with other netwo...
[palacios.git] / utils / guest_creator / main.c
index 140bbb3..15b85ce 100644 (file)
@@ -62,9 +62,25 @@ int main(int argc, char ** argv) {
     infile = argv[optind];
 
 
-    printf("Input file: %s\n", infile);
+    if (outfile == NULL) {
+       char * endptr = rindex(infile, '.');
+
+       outfile = malloc(strlen(infile) + strlen(".dat") + 1);
+
+       strncpy(outfile, infile, endptr - infile);
+
+       sprintf(outfile, "%s.dat", outfile);
+    }
+
+
+
+    printf("Input: [%s] ==>>  Output: [%s]\n", infile, outfile);
 
     ezxml_t cfg_input = ezxml_parse_file(infile);
+    if (strcmp("", ezxml_error(cfg_input)) != 0) {
+       printf("%s\n", ezxml_error(cfg_input));
+       return -1;
+    }
 
     if (cfg_input == NULL) {
        printf("Could not open configuration input file: %s\n", infile);
@@ -86,17 +102,6 @@ int main(int argc, char ** argv) {
 
     // write output
 
-    if (outfile == NULL) {
-       char * endptr = rindex(infile, '.');
-
-       outfile = malloc(strlen(infile) + strlen(".dat") + 1);
-
-       if (endptr) {
-           *endptr = '\0';
-       }
-
-       sprintf(outfile, "%s.dat", infile);
-    }
 
 
     write_output(outfile, cfg_input);
@@ -271,15 +276,15 @@ int copy_file(int file_index, FILE * data_file) {
            memset(cons_line, 0, 256);
            snprintf(cons_line, 256, "\r(%s) [", files[file_index].id);
            
-           for (i = 0; i < num_dots; i++) {
+           for (i = 0; i <= num_dots; i++) {
                strcat(cons_line, "=");
            }
            
-           for (i = 0; i < num_blanks; i++) {
+           for (i = 0; i < num_blanks - 1; i++) {
                strcat(cons_line, " ");
            }
            
-           strcat(cons_line, "]");
+           strcat(cons_line, "] ");
 
            //  printf("console width = %d\n", wsz.ws_col);
            write(STDIO_FD, cons_line, wsz.ws_col);