Index: head/math/prng/Makefile =================================================================== --- head/math/prng/Makefile (revision 510708) +++ head/math/prng/Makefile (revision 510709) @@ -1,37 +1,37 @@ # Created by: bf # $FreeBSD$ PORTNAME= prng DISTVERSION= 3.0.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= math MASTER_SITES= http://statistik.wu-wien.ac.at/software/prng/ MAINTAINER= ports@FreeBSD.org COMMENT= Portable, high-performance ANSI-C pseudorandom number generators LICENSE= GPLv2 USE_CSTD= gnu89 GNU_CONFIGURE= yes INFO= prng PLIST_FILES= include/prng.h lib/libprng.a PORTDOCS= prng.dvi prng.pdf prng.ps prng.txt PORTEXAMPLES= Makefile pairs.c tuples.c OPTIONS_DEFINE= DOCS EXAMPLES post-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/doc/,} ${STAGEDIR}${DOCSDIR} post-install-EXAMPLES-on: ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} ${INSTALL_DATA} ${PORTEXAMPLES:S,^,${WRKSRC}/examples/,} \ ${STAGEDIR}${EXAMPLESDIR} check regression-test test: build @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} \ ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS} check) .include Index: head/math/prng/files/patch-no-gets =================================================================== --- head/math/prng/files/patch-no-gets (nonexistent) +++ head/math/prng/files/patch-no-gets (revision 510709) @@ -0,0 +1,48 @@ +--- examples/pairs.c.orig 2019-06-30 22:57:59.603524000 +0300 ++++ examples/pairs.c 2019-06-30 23:06:55.659597000 +0300 +@@ -54,6 +54,18 @@ + #include + #include "prng.h" + ++static void ++safe_gets(char *buf, int size) ++{ ++ size_t len; ++ ++ if (fgets(buf, size, stdin) == NULL) ++ return; ++ len = strlen(buf); ++ if (len && buf[len - 1] == '\n') ++ buf[len - 1] = '\0'; ++} ++ + struct prng_struct *generator; + char outfile[200] = "pairs.out"; + FILE *out; +@@ -71,7 +83,7 @@ + else + { + printf("\nGenerator ? "); +- gets(input); ++ safe_gets(input, sizeof(input)); + g = prng_new(input); + } + +@@ -88,7 +100,7 @@ + { + npairs = 10000; + printf("\nHow many pairs [%d] ",npairs); +- gets(input); ++ safe_gets(input, sizeof(input)); + if (input[0] != 0 ) npairs = atoi(input); + } + +@@ -97,7 +109,7 @@ + else + { + printf("Output filename ('-' for stdout) ? [%s] ",outfile); +- gets(input); ++ safe_gets(input, sizeof(input)); + if (input[0] != 0 ) strncpy(outfile,input,100); + } + Property changes on: head/math/prng/files/patch-no-gets ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property