mirror of
https://git.freebsd.org/ports.git
synced 2025-07-17 17:29:23 -04:00
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
This commit is contained in:
parent
f70b7a5851
commit
4189935d94
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=511321
2 changed files with 46 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
PORTNAME= vnconvert
|
PORTNAME= vnconvert
|
||||||
PORTVERSION= 1.0
|
PORTVERSION= 1.0
|
||||||
|
PORTREVISION= 1
|
||||||
CATEGORIES= vietnamese
|
CATEGORIES= vietnamese
|
||||||
MASTER_SITES= LOCAL/obrien
|
MASTER_SITES= LOCAL/obrien
|
||||||
DISTNAME= convert
|
DISTNAME= convert
|
||||||
|
|
45
vietnamese/vnconvert/files/patch-vnconvert.c
Normal file
45
vietnamese/vnconvert/files/patch-vnconvert.c
Normal file
|
@ -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;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue