[syslinux:master] hdt: print tftp error number & message if dump failed

syslinux-bot for Erwan Velu erwanaliasr1 at gmail.com
Fri Sep 4 09:15:06 PDT 2015


Commit-ID:  d0fde22e65cb2c7b8af8e7d8a9f08d5de7941876
Gitweb:     http://www.syslinux.org/commit/d0fde22e65cb2c7b8af8e7d8a9f08d5de7941876
Author:     Erwan Velu <erwanaliasr1 at gmail.com>
AuthorDate: Wed, 19 Aug 2015 07:22:19 +0200
Committer:  Erwan Velu <erwanaliasr1 at gmail.com>
CommitDate: Fri, 4 Sep 2015 17:57:52 +0200

hdt: print tftp error number & message if dump failed

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.

---
 com32/hdt/hdt-dump.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/com32/hdt/hdt-dump.c b/com32/hdt/hdt-dump.c
index 7d608a0..03049d9 100644
--- a/com32/hdt/hdt-dump.c
+++ b/com32/hdt/hdt-dump.c
@@ -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);
     }


More information about the Syslinux-commits mailing list