diff options
| author | Michiel Van Der Kolk <not.valid@email.address> | 2005-04-28 17:03:45 +0000 |
|---|---|---|
| committer | Michiel Van Der Kolk <not.valid@email.address> | 2005-04-28 17:03:45 +0000 |
| commit | a43f90f56312a0a54196471ea7bee1e783b254cf (patch) | |
| tree | f73c804426157459f1bcb736c4ad7b2586364b23 /apps/plugins | |
| parent | 8c0dfb4d14c6e54ca410f90e97b29ef68fa19f9f (diff) | |
| download | rockbox-a43f90f56312a0a54196471ea7bee1e783b254cf.zip rockbox-a43f90f56312a0a54196471ea7bee1e783b254cf.tar.gz rockbox-a43f90f56312a0a54196471ea7bee1e783b254cf.tar.bz2 rockbox-a43f90f56312a0a54196471ea7bee1e783b254cf.tar.xz | |
scanf sucks >.<;
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6376 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
| -rw-r--r-- | apps/plugins/searchengine/tokentool.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/plugins/searchengine/tokentool.c b/apps/plugins/searchengine/tokentool.c index 9abfb0e..e87ede8 100644 --- a/apps/plugins/searchengine/tokentool.c +++ b/apps/plugins/searchengine/tokentool.c @@ -28,7 +28,7 @@ main() { int done=0; printf("Output filename? "); fflush(stdout); - scanf("%s",buf); + fgets(buf,254,stdin); fp=fopen(buf,"w"); if(fp<0) { printf("Error opening outputfile.\n"); @@ -41,13 +41,13 @@ main() { printf("(arguments:) NUMBER=14 NUMBERFIELD=15 STRING=16 STRINGFIELD=17\n"); printf("Token kind? "); fflush(stdout); - scanf("%d",&num); - token.kind=num; + fgets(buf,254,stdin); + token.kind=strtol(buf,0,10); memset(&token.spelling,0,256); if(token.kind==TOKEN_STRING) { printf("Token spelling? "); fflush(stdout); - scanf("%s",&token.spelling); + fgets(token.spelling,254,stdin); } if(token.kind==TOKEN_STRINGIDENTIFIER) printf("TITLE=4 ARTIST=5 ALBUM=6 GENRE=7 FILENAME=8\n"); @@ -59,8 +59,8 @@ main() { token.kind==TOKEN_NUM) { printf("Token intvalue? "); fflush(stdout); - scanf("%d",&num); - token.intvalue=num; + fgets(buf,254,stdin); + token.intvalue=strtol(buf,0,10); } fwrite(&token,sizeof(struct token),1,fp); done=token.kind==0; |