Changeset 136 for trunk/src/reglookup.c


Ignore:
Timestamp:
01/23/09 12:29:51 (15 years ago)
Author:
tim
Message:

fixed various integer issues and memory allocation issues

polished error message functions and added initial messages in a few places

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/reglookup.c

    r135 r136  
    255255      if((new_buf = realloc(buf, buf_len)) == NULL)
    256256      {
     257        free(name);
    257258        free(buf);
    258259        free(iter);
     
    372373  const REGFI_NK_REC* sub = NULL;
    373374  char* path = NULL;
     375  char* msgs = NULL;
    374376  int key_type = regfi_type_str2val("KEY");
    375377  bool print_this = true;
     
    377379  root = cur = regfi_iterator_cur_key(iter);
    378380  sub = regfi_iterator_first_subkey(iter);
    379  
     381  msgs = regfi_get_messages(iter->f);
     382  if(msgs != NULL)
     383    fprintf(stderr, "%s", msgs);
    380384  if(root == NULL)
    381385    bailOut(EX_DATAERR, "ERROR: root cannot be NULL.\n");
     
    455459  /* Strip any potential value name at end of path */
    456460  for(i=0;
    457       (path[i] != NULL) && (path[i+1] != NULL)
    458         && (i < REGFI_MAX_DEPTH+1+1);
     461      (path[i] != NULL) && (path[i+1] != NULL) && (i < REGFI_MAX_DEPTH+1);
    459462      i++)
    460     tmp_path[i] = path[i];
    461 
     463  { tmp_path[i] = path[i]; }
    462464  tmp_path[i] = NULL;
    463465
     
    471473    if(print_verbose)
    472474      fprintf(stderr, "VERBOSE: Found final path element as root key.\n");
     475    free(tmp_path);
    473476    return 2;
    474477  }
Note: See TracChangeset for help on using the changeset viewer.