From 2b793c72445753dedc89ba64eb8c1fafcfafe0e8 Mon Sep 17 00:00:00 2001 From: leitner Date: Thu, 16 Jan 2003 00:31:55 +0000 Subject: [PATCH] accept longer input --- test/b64encode.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/b64encode.c b/test/b64encode.c index 3360e9a..726ade9 100644 --- a/test/b64encode.c +++ b/test/b64encode.c @@ -15,10 +15,12 @@ main(int argc,char* argv[]) { } if (argc<2) { char src[1024]; - int len=read(0,src,sizeof(src)-1); - if (len==-1) return(1); - src[len]=0; - b64encode(src); + int len; + while ((len=read(0,src,sizeof(src)-1))>0) { + if (len==-1) return(1); + src[len]=0; + b64encode(src); + } } return 0; }