Ignore:
Timestamp:
02/12/09 22:24:27 (15 years ago)
Author:
tim
Message:

fixed a null pointer exception

removed some dependencies on less portable items

altered Makefiles to allow for MinGW cross compiling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/reglookup-recover.c

    r138 r143  
    2222#include <stdio.h>
    2323#include <stdlib.h>
    24 #include <sysexits.h>
    2524
    2625#include "../include/regfi.h"
     
    8483    quoted_name = malloc(1*sizeof(char));
    8584    if(quoted_name == NULL)
    86       bailOut(EX_OSERR, "ERROR: Could not allocate sufficient memory.\n");
     85      bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Could not allocate sufficient memory.\n");
    8786    quoted_name[0] = '\0';
    8887
     
    140139    quoted_name = malloc(1*sizeof(char));
    141140    if(quoted_name == NULL)
    142       bailOut(EX_OSERR, "ERROR: Could not allocate sufficient memory.\n");
     141      bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Could not allocate sufficient memory.\n");
    143142    quoted_name[0] = '\0';
    144143  }
     
    149148    quoted_value = malloc(1*sizeof(char));
    150149    if(quoted_value == NULL)
    151       bailOut(EX_OSERR, "ERROR: Could not allocate sufficient memory.\n");
     150      bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Could not allocate sufficient memory.\n");
    152151    quoted_value[0] = '\0';
    153152
     
    714713  {
    715714    usage();
    716     bailOut(EX_USAGE, "ERROR: Requires at least one argument.\n");
     715    bailOut(REGLOOKUP_EXIT_USAGE, "ERROR: Requires at least one argument.\n");
    717716  }
    718717 
     
    738737      usage();
    739738      fprintf(stderr, "ERROR: Unrecognized option: %s\n", argv[argi]);
    740       bailOut(EX_USAGE, "");
     739      bailOut(REGLOOKUP_EXIT_USAGE, "");
    741740    }
    742741  }
     
    744743
    745744  if((registry_file = strdup(argv[argi])) == NULL)
    746     bailOut(EX_OSERR, "ERROR: Memory allocation problem.\n");
     745    bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Memory allocation problem.\n");
    747746
    748747  f = regfi_open(registry_file);
     
    750749  {
    751750    fprintf(stderr, "ERROR: Couldn't open registry file: %s\n", registry_file);
    752     bailOut(EX_NOINPUT, "");
     751    bailOut(REGLOOKUP_EXIT_NOINPUT, "");
    753752  }
    754753  if(print_verbose)
Note: See TracChangeset for help on using the changeset viewer.