aboutsummaryrefslogtreecommitdiff
path: root/vietnamese
diff options
context:
space:
mode:
authorKai Knoblich <kai@FreeBSD.org>2019-09-06 15:41:15 +0000
committerKai Knoblich <kai@FreeBSD.org>2019-09-06 15:41:15 +0000
commit4189935d94c900bad83a6c9d11f4fcde0c37987f (patch)
treec94c7ef94febd6bf85e5d81682eefd3f41b0d290 /vietnamese
parentf70b7a58514ea9632846b13e3e816afc7880479d (diff)
downloadports-4189935d94c900bad83a6c9d11f4fcde0c37987f.tar.gz
ports-4189935d94c900bad83a6c9d11f4fcde0c37987f.zip
vietnamese/vnconvert: Replace gets(3) with gets_s(3)
The long deprecated and unsafe gets(3) function has been removed since FreeBSD 1300043. Thus replace the occurences of that function in the code with gets_s(3) which is a safer alternative. * Bump PORTREVISION due to changes in the code/package. PR: 238687 Reported by: emaste MFH: 2019Q3
Notes
Notes: svn path=/head/; revision=511321
Diffstat (limited to 'vietnamese')
-rw-r--r--vietnamese/vnconvert/Makefile1
-rw-r--r--vietnamese/vnconvert/files/patch-vnconvert.c45
2 files changed, 46 insertions, 0 deletions
diff --git a/vietnamese/vnconvert/Makefile b/vietnamese/vnconvert/Makefile
index 2f30b414f4ee..3b0813e9d237 100644
--- a/vietnamese/vnconvert/Makefile
+++ b/vietnamese/vnconvert/Makefile
@@ -3,6 +3,7 @@
PORTNAME= vnconvert
PORTVERSION= 1.0
+PORTREVISION= 1
CATEGORIES= vietnamese
MASTER_SITES= LOCAL/obrien
DISTNAME= convert
diff --git a/vietnamese/vnconvert/files/patch-vnconvert.c b/vietnamese/vnconvert/files/patch-vnconvert.c
new file mode 100644
index 000000000000..eb99f9e53243
--- /dev/null
+++ b/vietnamese/vnconvert/files/patch-vnconvert.c
@@ -0,0 +1,45 @@
+--- vnconvert.c.orig 1994-05-20 20:36:17 UTC
++++ vnconvert.c
+@@ -91,7 +91,7 @@ main()
+ printf("\t6 - VN Thin-Art (Mac)\n\n");
+
+ printf("Input-file name (or Enter to quit): ");
+- gets(bufline);
++ gets_s(bufline, 255);
+ if (strlen(bufline) == 0)
+ break;
+ sscanf(bufline, "%s", input_file);
+@@ -99,21 +99,21 @@ main()
+ printf("currently in the format number: ");
+ *bufline = '\0';
+ while (strlen(bufline)==0) {
+- gets(bufline);
++ gets_s(bufline, 255);
+ sscanf(bufline, "%d", &from);
+ }
+
+ printf("\nOutput-file name: ");
+ *bufline = '\0';
+ while (strlen(bufline)==0) {
+- gets(bufline);
++ gets_s(bufline, 255);
+ sscanf(bufline, "%s", output_file);
+ }
+
+ printf("to the format number: ");
+ *bufline = '\0';
+ while (strlen(bufline)==0) {
+- gets(bufline);
++ gets_s(bufline, 255);
+ sscanf(bufline, "%d", &to);
+ }
+
+@@ -152,7 +152,7 @@ main()
+ }
+ else {
+ fprintf(stderr, "\"%s\" already exists. Overwrite it (y/n)? ", output_file);
+- gets(buf);
++ gets_s(buf, BUFSIZ);
+ if (toupper(buf[0]) != 'Y')
+ icontinue = 1;
+ }