From dd1ee5f40f185d45141f04644505cb56dc101533 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 4 Jan 2015 21:34:11 +0000 Subject: make usage of strlcpy on linux possible throug usage of libbsd --- symbols.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'symbols.c') 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 +#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)) { -- cgit v1.2.3