From: joy <gracecott@sancharnet.in>
To: "Luiz Fernando N. Capitulino" <lcapitulino@terra.com.br>
Cc: lantis@iqranet.info, linux-c-programming@vger.kernel.org
Subject: Re: various doubts part 2
Date: Thu, 12 Aug 2004 16:19:44 +0530 [thread overview]
Message-ID: <411B4B48.9000901@sancharnet.in> (raw)
In-Reply-To: <20040811192131.52ff2760.lcapitulino@terra.com.br>
Luiz Fernando N. Capitulino wrote:
> Don't, I found the bug:
>
>while((bytes_read = read(STDIN_FILENO,buff,sizeof(buff))>0))
>
> look where ">0" is inside... If you change to:
>
>while((bytes_read = read(STDIN_FILENO,buff,sizeof(buff)))>0)
>
>
>
Ouch as usual, the retard in me begins to show up.........
> it will work... man, this bug needed about 20 min to be catch up...
>
> every time I did run the program I tought "it _must_ work, all is
>right"... Only saw the bug when I started to write it again myself. :)
>
>
>
You DO have some kind of obsessive compulsive disorder ( You remind me
of myself :-)
> and I didn't played with the second part of the code, because
>I didn't understand very well what do you want.
>
>PS(0): I'm not a C expert, but I advice you: *always* try to write
>clean code.
>
>PS(1): I worked in this because I can't sleep when something which
>should work don't work.
>
>
>
>
Thanks a lot, anyway I had rewritten the code using frread and fwrite,
forgot to do an fflush,
got empty output files , almost broke my computer , added an fclose just
after the fwrite,
got nice output files, cried in happiness, and swore to write clean code
an hour before I
read this mail ;-).
regards,
Joy.
prev parent reply other threads:[~2004-08-12 10:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-10 2:53 various doubts part 2 joy
2004-08-10 7:04 ` Sascha Retzki
2004-08-11 2:52 ` joy
2004-08-11 22:21 ` Luiz Fernando N. Capitulino
2004-08-12 10:49 ` joy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=411B4B48.9000901@sancharnet.in \
--to=gracecott@sancharnet.in \
--cc=lantis@iqranet.info \
--cc=lcapitulino@terra.com.br \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.