summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/searchengine/tokentool.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/plugins/searchengine/tokentool.c b/apps/plugins/searchengine/tokentool.c
index 9abfb0e7d3..e87ede8b0a 100644
--- a/apps/plugins/searchengine/tokentool.c
+++ b/apps/plugins/searchengine/tokentool.c
@@ -28,7 +28,7 @@ main() {
28 int done=0; 28 int done=0;
29 printf("Output filename? "); 29 printf("Output filename? ");
30 fflush(stdout); 30 fflush(stdout);
31 scanf("%s",buf); 31 fgets(buf,254,stdin);
32 fp=fopen(buf,"w"); 32 fp=fopen(buf,"w");
33 if(fp<0) { 33 if(fp<0) {
34 printf("Error opening outputfile.\n"); 34 printf("Error opening outputfile.\n");
@@ -41,13 +41,13 @@ main() {
41 printf("(arguments:) NUMBER=14 NUMBERFIELD=15 STRING=16 STRINGFIELD=17\n"); 41 printf("(arguments:) NUMBER=14 NUMBERFIELD=15 STRING=16 STRINGFIELD=17\n");
42 printf("Token kind? "); 42 printf("Token kind? ");
43 fflush(stdout); 43 fflush(stdout);
44 scanf("%d",&num); 44 fgets(buf,254,stdin);
45 token.kind=num; 45 token.kind=strtol(buf,0,10);
46 memset(&token.spelling,0,256); 46 memset(&token.spelling,0,256);
47 if(token.kind==TOKEN_STRING) { 47 if(token.kind==TOKEN_STRING) {
48 printf("Token spelling? "); 48 printf("Token spelling? ");
49 fflush(stdout); 49 fflush(stdout);
50 scanf("%s",&token.spelling); 50 fgets(token.spelling,254,stdin);
51 } 51 }
52 if(token.kind==TOKEN_STRINGIDENTIFIER) 52 if(token.kind==TOKEN_STRINGIDENTIFIER)
53 printf("TITLE=4 ARTIST=5 ALBUM=6 GENRE=7 FILENAME=8\n"); 53 printf("TITLE=4 ARTIST=5 ALBUM=6 GENRE=7 FILENAME=8\n");
@@ -59,8 +59,8 @@ main() {
59 token.kind==TOKEN_NUM) { 59 token.kind==TOKEN_NUM) {
60 printf("Token intvalue? "); 60 printf("Token intvalue? ");
61 fflush(stdout); 61 fflush(stdout);
62 scanf("%d",&num); 62 fgets(buf,254,stdin);
63 token.intvalue=num; 63 token.intvalue=strtol(buf,0,10);
64 } 64 }
65 fwrite(&token,sizeof(struct token),1,fp); 65 fwrite(&token,sizeof(struct token),1,fp);
66 done=token.kind==0; 66 done=token.kind==0;