Thread: Message Board

  1. #16
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Cprogramming.com: FAQ
    And what does not appended correctly mean, exactly?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #17
    Registered User
    Join Date
    Jun 2008
    Posts
    266
    Quote Originally Posted by Elysia View Post
    Cprogramming.com: FAQ
    And what does not appended correctly mean, exactly?
    Sorry about the FAQ answer I should have recognized that. Not appended correctly means the input entered in the form isn't added to the end of the file and in return not printed in the output.
    Fried chicken for everybody!
    -Kernel Sanders

  3. #18
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Do not use feof() to control loops!
    Code:
    while(!feof(log))
    Use your read function to check if it was possible to read or not.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #19
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    FYI, it's a terrible idea to write a message board with C.

    It's basically like opening the web server up to the world with the thousand of bugs you're introducing (either knowingly or not).

    So if you plan to use this... don't

  5. #20
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    I totally agree. You can't write any real programs in C! It's just for hello world!


    Quzah.
    Hope is the first step on the road to disappointment.

  6. #21
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Now why is it that if I suggested that, I would get people breathing down my neck, and yet here two people are suggesting that this should not be done in C?
    I totally agree, though.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #22
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    That was sarcasm actually.


    Quzah.
    Hope is the first step on the road to disappointment.

  8. #23
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I see. It was fun to see anyway, though.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #24
    Registered User
    Join Date
    Jun 2008
    Posts
    266
    As long as there are no bugs though, there are no security vulnerabilities. Btw, does anybody know how to prevent the error where the message board can't access the text file because Apache doesn't allow it? That's really the last step to finishing the message board.
    Fried chicken for everybody!
    -Kernel Sanders

  10. #25
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by lruc View Post
    As long as there are no bugs though, there are no security vulnerabilities.
    Not really. Technically speaking, gets isn't a "bug", but that doesn't mean it's not a security risk.


    Quzah.
    Hope is the first step on the road to disappointment.

  11. #26
    Registered User
    Join Date
    Jun 2008
    Posts
    266
    Quote Originally Posted by quzah View Post
    Not really. Technically speaking, gets isn't a "bug", but that doesn't mean it's not a security risk.


    Quzah.
    No but it's in the bug family because it's such a stupid function. Still, for a simple test program it can be nice sometimes.
    Fried chicken for everybody!
    -Kernel Sanders

  12. #27
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Now we just have to hope that test programs don't become part of programs that people use....

  13. #28
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    do not use feof to control loop - read faq

    use return value of fgets instead
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  14. #29
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by lruc View Post
    As long as there are no bugs though, there are no security vulnerabilities. Btw, does anybody know how to prevent the error where the message board can't access the text file because Apache doesn't allow it? That's really the last step to finishing the message board.
    fopen will either fail or succeed. No error will be printed by Apache.
    If the program crashes, however, you can be sure you will get an error.
    Therefore, properly check the return of fopen to make sure you don't call any other file functions if it didn't succeed. Then you can choose what you want to do about it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Global Variables
    By Taka in forum C Programming
    Replies: 34
    Last Post: 11-02-2007, 03:25 AM
  2. Isn't the C Board a cool name?
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 12-23-2002, 01:09 PM
  3. Message Board singatures
    By Shadow in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 02-16-2002, 12:36 PM
  4. Java Message board
    By darthxmark in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-23-2002, 03:15 AM