aboutsummaryrefslogtreecommitdiff
path: root/symbols.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-01-04 21:34:11 +0000
committerDimitri Sokolyuk <demon@dim13.org>2015-01-04 21:34:11 +0000
commitdd1ee5f40f185d45141f04644505cb56dc101533 (patch)
tree29537f9f890f8ed60bde9b9a80bab718ee760c6f /symbols.c
parentc1cf67f5492046c09e14b159bb1815b7a770ab99 (diff)
make usage of strlcpy on linux possible throug usage of libbsd
Diffstat (limited to 'symbols.c')
-rw-r--r--symbols.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/symbols.c b/symbols.c
index 70627b7..be4ab32 100644
--- a/symbols.c
+++ b/symbols.c
@@ -17,6 +17,10 @@
#include "stack.h"
#include "symbols.h"
+#if defined(__linux__)
+#include <bsd/string.h>
+#endif
+
func_t functions[MAX_FUNCTIONS];
unsigned int totals[MAX_FUNCTIONS];
unsigned int calls[MAX_FUNCTIONS][MAX_FUNCTIONS];
@@ -60,7 +64,7 @@ translateFunctionFromSymbol(unsigned int address, char *func)
{
FILE *p;
char line[100];
- int len, i;
+ int i;
snprintf(line, sizeof(line), "addr2line -e %s -f -s 0x%x", imageName, address);
@@ -69,7 +73,7 @@ translateFunctionFromSymbol(unsigned int address, char *func)
if (p == NULL)
return 0;
- len = fread(line, 99, 1, p);
+ fread(line, 99, 1, p);
for (i = 0; i < strlen(line); i++) {
if ((line[i] == 0x0d) || (line[i] == 0x0a)) {