Menu

#1 BIG problem in windows version in function: get_uniqnum

closed-fixed
nobody
None
5
2007-12-06
2007-12-05
Anonymous
No

Server can store only 27 messages (or 28) and after that can't. Problem is in file: database.c in function get_uniqnum. Function can't read from file after id 28.

Wrong is this:
if (!(fp=fopen(MSGID_FILE, "r+"))) {
id = 0;
fp = fopen(MSGID_FILE, "w+");

You must change this in:
if (!(fp=fopen(MSGID_FILE, "rb+"))) {
id = 0;
fp = fopen(MSGID_FILE, "wb+");

On windows that is not same!

I am make test code (in attachment). Please try that on windows, with rb+, wb+ and without "rb+, wb+. Execute program 28 times, and you will see that on windows you must change r+ w+ to rb+ and wb+.

Can you fix this BUG and make new version 1.0.5 ?

Discussion

  • Nobody/Anonymous

    Test program

     
  • Steffen Wendzel

    Steffen Wendzel - 2007-12-06

    Many thanks for the report. The bug is now fixed.

    • status: open --> closed-fixed
     

    Last edit: Steffen Wendzel 2015-03-28

Log in to post a comment.