- Timestamp:
- 07/30/06 15:32:43 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/reglookup.c
r70 r71 219 219 *error_msg = (char*)malloc(65+strlen(str_type)+strlen(tmp_err)+1); 220 220 if(*error_msg == NULL) 221 { 222 free(ascii); 221 223 return NULL; 224 } 222 225 sprintf(*error_msg, "Unicode conversion failed on %s field; " 223 226 "printing as binary. Error: %s", str_type, tmp_err); … … 228 231 cur_quoted = quote_string(ascii, common_special_chars); 229 232 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 } 230 239 return cur_quoted; 231 240 break; … … 296 305 *error_msg = (char*)malloc(90+strlen(tmp_err)+1); 297 306 if(*error_msg == NULL) 307 { 308 free(cur_str); 309 free(cur_ascii); 310 free(ascii); 298 311 return NULL; 312 } 299 313 sprintf(*error_msg, "Unicode conversion failed on at least one " 300 314 "MULTI_SZ sub-field; printing as binary. Error: %s", … … 346 360 return quote_buffer(datap, len, common_special_chars); 347 361 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); 353 369 354 370 return NULL; … … 498 514 { 499 515 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'. " 501 517 "Memory allocation failure likely.\n", prefix, quoted_name); 502 518 else 503 fprintf(stderr, " ERROR: Could not quote value for '%s/%s'. "519 fprintf(stderr, "WARNING: Could not quote value for '%s/%s'. " 504 520 "Returned error: %s\n", prefix, quoted_name, conv_error); 505 521 }
Note: See TracChangeset
for help on using the changeset viewer.