diff --git a/gsw_check_functions.c b/gsw_check_functions.c index de63d5f..0c9fe13 100644 --- a/gsw_check_functions.c +++ b/gsw_check_functions.c @@ -660,7 +660,7 @@ report(const char *funcname, const 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) {