pick: Update from 2.0.1 to 2.0.2
[termux-packages] / packages / elfutils / dwfl_error.c.patch
CommitLineData
cf310881
FF
1diff -u -r ../elfutils-0.166/libdwfl/dwfl_error.c ./libdwfl/dwfl_error.c
2--- ../elfutils-0.166/libdwfl/dwfl_error.c 2015-11-27 08:36:29.000000000 -0500
3+++ ./libdwfl/dwfl_error.c 2016-05-04 13:15:42.522820139 -0400
4@@ -140,6 +140,7 @@
5 const char *
6 dwfl_errmsg (int error)
7 {
8+ char* error_msg;
9 if (error == 0 || error == -1)
10 {
11 int last_error = global_error;
12@@ -154,7 +155,9 @@
13 switch (error &~ 0xffff)
14 {
15 case OTHER_ERROR (ERRNO):
16- return strerror_r (error & 0xffff, "bad", 0);
17+ error_msg = malloc(256);
18+ strerror_r (error & 0xffff, error_msg, 256);
19+ return error_msg;
20 case OTHER_ERROR (LIBELF):
21 return elf_errmsg (error & 0xffff);
22 case OTHER_ERROR (LIBDW):