Fix mergecap.c: Dereference of null pointer (clang analyzer)

Change-Id: I89076388db8522c5fbdf72505f50e1380f1ab391
Reviewed-on: https://code.wireshark.org/review/369
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
Hadriel Kaplan 2014-02-25 11:10:50 -05:00 committed by Alexis La Goutte
parent bd36fe1bcb
commit 7955654911
1 changed files with 2 additions and 2 deletions

View File

@ -512,7 +512,7 @@ main(int argc, char *argv[])
* report the frame number and file type/subtype.
*/
fprintf(stderr, "mergecap: Frame %u of \"%s\" has a network type that can't be saved in a \"%s\" file.\n",
in_file->packet_num, in_file->filename,
in_file ? in_file->packet_num : 0, in_file ? in_file->filename : "UNKNOWN",
wtap_file_type_subtype_string(file_type));
break;
@ -523,7 +523,7 @@ main(int argc, char *argv[])
* report the frame number and file type/subtype.
*/
fprintf(stderr, "mergecap: Frame %u of \"%s\" is too large for a \"%s\" file\n.",
in_file->packet_num, in_file->filename,
in_file ? in_file->packet_num : 0, in_file ? in_file->filename : "UNKNOWN",
wtap_file_type_subtype_string(file_type));
break;