Skip to content

Commit

Permalink
sprintf is deprecated according to clang (c++) on mac
Browse files Browse the repository at this point in the history
Replaced by snprintf
  • Loading branch information
peter-urban committed Nov 12, 2024
1 parent 130b114 commit 4d28d79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gsw_check_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4d28d79

Please sign in to comment.