From 4cad974bb7034ef3f0f89cf837baf5261da6568f Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sat, 5 Jan 2019 18:13:04 +0800 Subject: [PATCH] Fix Windows warnings --- src/lib.c | 2 +- src/util.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib.c b/src/lib.c index 05f8a275..2d73d481 100644 --- a/src/lib.c +++ b/src/lib.c @@ -124,7 +124,7 @@ static lib_t lib_init(const char *name, const char *rpath, int lock_fd) if (rpath == NULL) l->path[0] = '\0'; else if (realpath(rpath, l->path) == NULL) - strncpy(l->path, rpath, PATH_MAX); + checked_sprintf(l->path, PATH_MAX, "%s", rpath); lib_list_t *el = xmalloc(sizeof(lib_list_t)); el->item = l; diff --git a/src/util.c b/src/util.c index 238758d8..053e6325 100644 --- a/src/util.c +++ b/src/util.c @@ -1098,6 +1098,7 @@ static void bt_sighandler(int sig, siginfo_t *info, void *secret) #endif // NO_STACK_TRACE +#if defined __linux__ static bool scan_file_for_token(const char *file, const char *token) { bool found = false; @@ -1113,6 +1114,7 @@ static bool scan_file_for_token(const char *file, const char *token) return found; } +#endif bool is_debugger_running(void) { -- 2.39.2