Samuel Tesla (stesla) wrote in lj_dev,
Samuel Tesla
stesla
lj_dev

I C a bug, but I can't C how to fix it...

In my client code, I'm using fgets() to read in my console input...but, if I enter more on the stream than fgets() reads in, it gets read into the next stream...which may or may not be bad (in this case it is).

I've tried doing things like using fseek(), but that doesn't work for stdin. I'm tempted to try and slurp away the extra bytes with an extra fgets(), but I'm sure there's a Better Way To Do It (TM).

Any suggestions?
Subscribe

  • cl-journal livejournal client

    Hey everyone, I'd like to present a livejournal client that I wrote to fulfill my needs but maybe there are other people that can find it…

  • SessionGenerate and ljloggedin

    Are there any information after release 86 and changes in cookies scheme to use sessiongenerate? It returns ljsession key, but this key is not enough…

  • Retrieving comments

    Hi, Is there a way to retrieve a list of comments made by user XXX (which may or may be not the currently logged in user) in the journals of users…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 4 comments