svn commit: r451423 - head/comms/yagiuda/files
Diane Bruce
db at FreeBSD.org
Sat Oct 7 01:24:18 UTC 2017
Author: db
Date: Sat Oct 7 01:24:16 2017
New Revision: 451423
URL: https://svnweb.freebsd.org/changeset/ports/451423
Log:
Remove the two gets() calls and replace with fgets()
https://reviews.freebsd.org/D12298
Whilst here redo the patches with make makepatch
PR: ports/222796
Reported by: emaste@
Added:
head/comms/yagiuda/files/patch-src_genetic__algorithm__lib.c (contents, props changed)
Deleted:
head/comms/yagiuda/files/patch-src_genetic_algorithm_lib.c
Modified:
head/comms/yagiuda/files/patch-src_gain.c (contents, props changed)
head/comms/yagiuda/files/patch-src_input.c (contents, props changed)
head/comms/yagiuda/files/patch-src_output.c (contents, props changed)
head/comms/yagiuda/files/patch-src_random.c (contents, props changed)
head/comms/yagiuda/files/patch-src_string.c (contents, props changed)
head/comms/yagiuda/files/patch-src_yagi.c (contents, props changed)
Modified: head/comms/yagiuda/files/patch-src_gain.c
==============================================================================
--- head/comms/yagiuda/files/patch-src_gain.c Sat Oct 7 00:19:54 2017 (r451422)
+++ head/comms/yagiuda/files/patch-src_gain.c Sat Oct 7 01:24:16 2017 (r451423)
@@ -1,5 +1,5 @@
---- src/gain.c.orig Tue Jul 19 12:24:45 2005
-+++ src/gain.c Tue Jul 19 12:24:50 2005
+--- src/gain.c.orig 2000-10-28 11:45:51 UTC
++++ src/gain.c
@@ -3,7 +3,6 @@
#endif
#include <stdio.h>
Added: head/comms/yagiuda/files/patch-src_genetic__algorithm__lib.c
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/comms/yagiuda/files/patch-src_genetic__algorithm__lib.c Sat Oct 7 01:24:16 2017 (r451423)
@@ -0,0 +1,22 @@
+--- src/genetic_algorithm_lib.c.orig 2000-10-28 13:04:39 UTC
++++ src/genetic_algorithm_lib.c
+@@ -3,9 +3,8 @@
+ #endif
+ #include <string.h>
+
+-#include <values.h>
+-#include <math.h>
+ #include <sys/types.h>
++#include <math.h>
+ #include <errno.h>
+ #include "yagi.h"
+
+@@ -245,7 +244,7 @@ int Selection(FILE *fd, int gen)
+ GeneRecord *temp ;
+ double minfit,maxfit ;
+ sigma=0.0 ;
+- minfit=MAXDOUBLE ;
++ minfit=MAXFLOAT;
+ maxfit=-minfit ;
+ /* minfit=1e308; maxfit=-1e308; XXXXXXXXXXXXXXXXXXXXXX */
+ for(a=0 ; a<population_size ; a++ )
Modified: head/comms/yagiuda/files/patch-src_input.c
==============================================================================
--- head/comms/yagiuda/files/patch-src_input.c Sat Oct 7 00:19:54 2017 (r451422)
+++ head/comms/yagiuda/files/patch-src_input.c Sat Oct 7 01:24:16 2017 (r451423)
@@ -1,10 +1,37 @@
---- src/input.c.orig Tue Jul 19 12:24:11 2005
-+++ src/input.c Tue Jul 19 12:24:18 2005
-@@ -16,7 +16,6 @@
+--- src/input.c.orig 2005-07-10 09:16:31 UTC
++++ src/input.c
+@@ -16,7 +16,6 @@ manually!
*/
-
+
#include <stdio.h>
-#include <malloc.h>
#include <math.h>
#include "nrutil.h"
#include "yagi.h"
+@@ -32,8 +31,9 @@ int main(int argc, char **argv)
+ char response, *filename, *notes, *type, data_entry;
+ FILE *fp;
+
+- filename = string(0L, 1000L);
+- notes = string(0L, 1000L);
++#define MAXINPUTLINE 1000
++ filename = string(0L, MAXINPUTLINE);
++ notes = string(0L, MAXINPUTLINE);
+ type = string(0L, 1000L);
+
+ while ((c = getoptions(argc,argv,"h")) != -1)
+@@ -56,10 +56,10 @@ int main(int argc, char **argv)
+ printf("\nThis program asks for length, diameter and position of antenna elements then\n");
+ printf("writes them to a file you specify. Data is written in m (metres)\n \n");
+ printf("Enter any notes on this design (up to 400 characters): ");
+- gets(notes);
+- printf("Enter a filename to write data to ");
+- gets(filename);
+- printf("Enter the centre frequency in MHz ");
++ fgets(notes, MAXINPUTLINE-1, stdin);
++ printf("Enter a filename to write data to ");
++ fgets(filename, MAXINPUTLINE-1, stdin);
++ printf("Enter the centre frequency in MHz ");
+ scanf("%lf", &frequency);
+ printf("Enter the minimum frequency in MHz ");
+ scanf("%lf", &min_f);
Modified: head/comms/yagiuda/files/patch-src_output.c
==============================================================================
--- head/comms/yagiuda/files/patch-src_output.c Sat Oct 7 00:19:54 2017 (r451422)
+++ head/comms/yagiuda/files/patch-src_output.c Sat Oct 7 01:24:16 2017 (r451423)
@@ -1,8 +1,8 @@
---- src/output.c.orig Tue Jul 19 12:24:27 2005
-+++ src/output.c Tue Jul 19 12:24:35 2005
-@@ -11,7 +11,6 @@
+--- src/output.c.orig 2000-10-29 14:43:15 UTC
++++ src/output.c
+@@ -11,7 +11,6 @@ of system memory.
#ifdef HAVE_STDLIB_H
-
+
#endif
-#include <malloc.h>
#include <math.h>
Modified: head/comms/yagiuda/files/patch-src_random.c
==============================================================================
--- head/comms/yagiuda/files/patch-src_random.c Sat Oct 7 00:19:54 2017 (r451422)
+++ head/comms/yagiuda/files/patch-src_random.c Sat Oct 7 01:24:16 2017 (r451423)
@@ -1,10 +1,10 @@
---- src/random.c.orig Tue Jul 19 12:36:04 2005
-+++ src/random.c Tue Jul 19 12:36:13 2005
-@@ -42,7 +42,6 @@
+--- src/random.c.orig 2000-10-28 11:43:17 UTC
++++ src/random.c
+@@ -42,7 +42,6 @@ return(VAX_integer_random_number_generat
#endif
-
-
+
+
-#include <values.h>
#include "yagi.h"
-
+
double randreal(void)
Modified: head/comms/yagiuda/files/patch-src_string.c
==============================================================================
--- head/comms/yagiuda/files/patch-src_string.c Sat Oct 7 00:19:54 2017 (r451422)
+++ head/comms/yagiuda/files/patch-src_string.c Sat Oct 7 01:24:16 2017 (r451423)
@@ -1,10 +1,10 @@
---- src/string.c.orig Tue Jul 19 12:23:46 2005
-+++ src/string.c Tue Jul 19 12:23:56 2005
+--- src/string.c.orig 2000-10-28 13:54:45 UTC
++++ src/string.c
@@ -2,7 +2,6 @@
#include <stdlib.h>
#endif
#include <stdio.h>
-#include <malloc.h>
#include "yagi.h"
-
-
+
+
Modified: head/comms/yagiuda/files/patch-src_yagi.c
==============================================================================
--- head/comms/yagiuda/files/patch-src_yagi.c Sat Oct 7 00:19:54 2017 (r451422)
+++ head/comms/yagiuda/files/patch-src_yagi.c Sat Oct 7 01:24:16 2017 (r451423)
@@ -1,8 +1,8 @@
---- src/yagi.c.orig Tue Jul 19 12:23:10 2005
-+++ src/yagi.c Tue Jul 19 12:23:33 2005
-@@ -19,7 +19,7 @@
-
-
+--- src/yagi.c.orig 2005-07-09 19:59:56 UTC
++++ src/yagi.c
+@@ -19,7 +19,7 @@ formulae */
+
+
#include <stdio.h>
-#include <malloc.h>
+#include <stdlib.h>
More information about the svn-ports-head
mailing list