From 86b66429431ae5daf11d4f7262444c331e64e9bf Mon Sep 17 00:00:00 2001 From: Peter Urban Date: Mon, 11 Nov 2024 15:11:00 +0100 Subject: [PATCH] sprintf is deprecated according to clang (c++) on mac Replaced by snprintf --- gsw_check_functions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gsw_check_functions.c b/gsw_check_functions.c index b8bab4b..25ff7bc 100644 --- a/gsw_check_functions.c +++ b/gsw_check_functions.c @@ -660,7 +660,7 @@ report(char *funcname, char *varname, gsw_error_info *errs) } strcat(message, ")"); } - sprintf(infoflg,"(%s%3d)",(errs->flags & GSW_ERROR_LIMIT_FLAG)?"*":"", + snprintf(infoflg, sizeof(infoflg), "(%s%3d)", (errs->flags & GSW_ERROR_LIMIT_FLAG)?"*":"", errs->ncomp); ndots = 65 - strlen(message); if (errs->flags & GSW_ERROR_ERROR_FLAG) {