Skip to content

Commit 83a5255

Browse files
authored
Merge pull request #82 from peter-urban/fix_sprintf_is_deprecated
Fix sprintf is deprecated (macos / clang / c++)
2 parents 130b114 + 4d28d79 commit 83a5255

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gsw_check_functions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ report(const char *funcname, const char *varname, gsw_error_info *errs)
660660
}
661661
strcat(message, ")");
662662
}
663-
sprintf(infoflg,"(%s%3d)",(errs->flags & GSW_ERROR_LIMIT_FLAG)?"*":"",
663+
snprintf(infoflg, sizeof(infoflg), "(%s%3d)", (errs->flags & GSW_ERROR_LIMIT_FLAG)?"*":"",
664664
errs->ncomp);
665665
ndots = 65 - strlen(message);
666666
if (errs->flags & GSW_ERROR_ERROR_FLAG) {

0 commit comments

Comments
 (0)