Skip to content

Commit

Permalink
hdt: print tftp error number & message if dump failed
Browse files Browse the repository at this point in the history
The current code was making a mistake by searching the -err element in
the array as it was resulting into a negative value.

The current patch does print the error number which could be useful but
also retrieve the proper string to indicate the real error we
encountered.
  • Loading branch information
ErwanAliasr1 committed Sep 4, 2015
1 parent ac87e80 commit d0fde22
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion com32/hdt/hdt-dump.c
Expand Up @@ -228,7 +228,8 @@ void dump(struct s_hardware *hardware)
/* As we manage a tftp connection, let's display the associated error message */
more_printf("Dump failed !\n");
more_printf("TFTP ERROR on : %s:/%s \n", hardware->tftp_ip, filename);
more_printf("TFTP ERROR msg : %s \n", tftp_string_error_message[-err]);
more_printf("TFTP ERROR num : %d \n", err);
more_printf("TFTP ERROR msg : %s \n", tftp_string_error_message[err]);
} else {
more_printf("Dump file sent at %s:/%s\n", hardware->tftp_ip, filename);
}
Expand Down

0 comments on commit d0fde22

Please sign in to comment.