zap gets usage. very straightforward, since all those are to fixed sized

buffers (also synch the documentation, which contains cut&paste from
the original code).
This commit is contained in:
espie 2014-03-23 17:22:45 +00:00
parent ee08c2d266
commit 8f4233bbd5
5 changed files with 53 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.71 2013/12/08 16:42:24 espie Exp $
# $OpenBSD: Makefile,v 1.72 2014/03/23 17:22:45 espie Exp $
COMMENT-main = Japanese input method
COMMENT-dict = dictionaries for Japanese Wnn
@ -16,19 +16,19 @@ CATEGORIES = japanese
MULTI_PACKAGES = -main -dict -zh -zhdict -ko -kodict -xwnmo -data
PKGNAME-main = ja-Wnn-4.2
REVISION-main = 7
REVISION-main = 8
PKGNAME-dict = ja-Wnndict-4.2
REVISION-dict = 0
PKGNAME-zh = zh-Wnn-4.2
REVISION-zh = 1
REVISION-zh = 2
PKGNAME-zhdict = zh-Wnndict-4.2
REVISION-zhdict = 0
PKGNAME-ko = ko-Wnn-4.2
REVISION-ko = 1
REVISION-ko = 2
PKGNAME-kodict = ko-Wnndict-4.2
REVISION-kodict = 0
PKGNAME-xwnmo = Wnn-xwnmo-4.2
REVISION-xwnmo = 3
REVISION-xwnmo = 4
PKGNAME-data = Wnn-data-4.2
WNNDICBASE = /var

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-Wnn_jlib_kankana_c,v 1.1 2014/03/23 17:22:45 espie Exp $
--- Wnn/jlib/kankana.c.orig Sun Mar 23 18:09:05 2014
+++ Wnn/jlib/kankana.c Sun Mar 23 18:09:41 2014
@@ -141,7 +141,7 @@ henkan()
for(;;){
if(c_env == env){printf("yomi> ");fflush(stdout);}
else {printf("kanji> ");fflush(stdout);}
- if(gets(yomi) == NULL)return;
+ if(fgets(yomi, sizeof yomi, stdin) == NULL)return;
if(yomi[0] == '!')return;
if(yomi[0] == '@'){
c_env = (c_env == env)? rev_env:env;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-Wnn_jutil_wddel_c,v 1.1 2014/03/23 17:22:45 espie Exp $
--- Wnn/jutil/wddel.c.orig Sun Mar 23 18:10:08 2014
+++ Wnn/jutil/wddel.c Sun Mar 23 18:10:25 2014
@@ -199,7 +199,7 @@ char **argv;
fprintf(stderr, "The specified dictionary isn't registable\n");
exit(1);
}
- while(gets(s)){
+ while(fgets(s, sizeof s, stdin)){
char com[LENGTHYOMI];
char Com[LENGTHYOMI];
int ima, hindo;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-Wnn_manual_intro,v 1.1 2014/03/23 17:22:45 espie Exp $
--- Wnn/manual/intro.orig Sun Mar 23 18:10:46 2014
+++ Wnn/manual/intro Sun Mar 23 18:11:07 2014
@@ -626,7 +626,7 @@ henkan()
for(;;){
if(c_env == env){printf("yomi> ");fflush(stdout);}
else {printf("kanji> ");fflush(stdout);}
- if(gets(yomi) == NULL)return;
+ if(fgets(yomi, sizeof yomi, stdin) == NULL)return;
if(yomi[0] == '!')return;
if(yomi[0] == '@'){
c_env = (c_env == env)? rev_env:env;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-Wnn_manual_v3tov4_v3tov4,v 1.1 2014/03/23 17:22:45 espie Exp $
--- Wnn/manual/v3tov4/v3tov4.orig Sun Mar 23 18:11:39 2014
+++ Wnn/manual/v3tov4/v3tov4 Sun Mar 23 18:11:48 2014
@@ -547,7 +547,7 @@ henkan()
for(;;){
if(c_env == env){printf("yomi> ");fflush(stdout);}
else {printf("kanji> ");fflush(stdout);}
- if(gets(yomi) == NULL)return;
+ if(fgets(yomi, sizeof yomi, stdin) == NULL)return;
if(yomi[0] == '!')return;
if(yomi[0] == '@'){
c_env = (c_env == env)? rev_env:env;