Changeset 126 for trunk/src/reglookup.c


Ignore:
Timestamp:
08/19/08 19:31:33 (16 years ago)
Author:
tim
Message:

improved validation and output of key class names, MULTI_SZ and other unicode strings, and improved warnings and other error messages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/reglookup.c

    r125 r126  
    9797              "Returned error: %s\n", prefix, quoted_name, conv_error);
    9898  }
    99   /* XXX: should these always be printed? */
    10099  else if(conv_error != NULL && print_verbose)
    101100    fprintf(stderr, "VERBOSE: While quoting value for '%s/%s', "
     
    296295  char* dacl = NULL;
    297296  char* quoted_classname;
     297  char* error_msg = NULL;
    298298  char mtime[20];
    299299  time_t tmp_time[1];
     
    322322
    323323    if(k->classname != NULL)
    324       quoted_classname = quote_string(k->classname, key_special_chars);
     324    {
     325      quoted_classname = quote_unicode((uint8*)k->classname, k->classname_length,
     326                                       key_special_chars, &error_msg);
     327      if(quoted_classname == NULL)
     328      {
     329        if(error_msg == NULL)
     330          fprintf(stderr, "ERROR: Could not quote classname"
     331                  " for key '%s' due to unknown error.\n", full_path);
     332        else
     333        {
     334          fprintf(stderr, "ERROR: Could not quote classname"
     335                  " for key '%s' due to error: %s\n", full_path, error_msg);
     336          free(error_msg);
     337        }
     338      }
     339      else if (error_msg != NULL)
     340      {
     341        if(print_verbose)
     342          fprintf(stderr, "WARNING: While converting classname"
     343                  " for key '%s': %s.\n", full_path, error_msg);
     344        free(error_msg);
     345      }
     346    }
    325347    else
    326348      quoted_classname = empty_str;
Note: See TracChangeset for help on using the changeset viewer.