Changeset 71


Ignore:
Timestamp:
07/30/06 15:32:43 (18 years ago)
Author:
tim
Message:

added additional warnings for broken registry entries.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/reglookup.c

    r70 r71  
    219219      *error_msg = (char*)malloc(65+strlen(str_type)+strlen(tmp_err)+1);
    220220      if(*error_msg == NULL)
     221      {
     222        free(ascii);
    221223        return NULL;
     224      }
    222225      sprintf(*error_msg, "Unicode conversion failed on %s field; "
    223226               "printing as binary.  Error: %s", str_type, tmp_err);
     
    228231      cur_quoted = quote_string(ascii, common_special_chars);
    229232    free(ascii);
     233    if(cur_quoted == NULL)
     234    {
     235      *error_msg = (char*)malloc(27+1);
     236      if(*error_msg != NULL)
     237        strcpy(*error_msg, "Buffer could not be quoted.");
     238    }
    230239    return cur_quoted;
    231240    break;
     
    296305            *error_msg = (char*)malloc(90+strlen(tmp_err)+1);
    297306            if(*error_msg == NULL)
     307            {
     308              free(cur_str);
     309              free(cur_ascii);
     310              free(ascii);
    298311              return NULL;
     312            }
    299313            sprintf(*error_msg, "Unicode conversion failed on at least one "
    300314                    "MULTI_SZ sub-field; printing as binary.  Error: %s",
     
    346360    return quote_buffer(datap, len, common_special_chars);
    347361    break;
    348 
    349   default:
    350     return NULL;
    351     break;
    352   }
     362  }
     363
     364
     365  /* Invalid type */
     366  *error_msg = (char*)malloc(33+11+1);
     367  if(*error_msg != NULL)
     368    sprintf(*error_msg, "Unrecognized registry data type: %d", type);
    353369
    354370  return NULL;
     
    498514  {
    499515    if(conv_error == NULL)
    500       fprintf(stderr, "ERROR: Could not quote value for '%s/%s'.  "
     516      fprintf(stderr, "WARNING: Could not quote value for '%s/%s'.  "
    501517              "Memory allocation failure likely.\n", prefix, quoted_name);
    502518    else
    503       fprintf(stderr, "ERROR: Could not quote value for '%s/%s'.  "
     519      fprintf(stderr, "WARNING: Could not quote value for '%s/%s'.  "
    504520              "Returned error: %s\n", prefix, quoted_name, conv_error);
    505521  }
Note: See TracChangeset for help on using the changeset viewer.