While this isn't a specific ROM question, I've discovered this problem While
working on my mud.

Therefore, I'm going post among my fellow ROM programmers.
Brief history:

Quest code, reading from a flat ascii text file.
The file is contents look like this:
150845
956375612 007 1015018986

That's it.  The first number is a vnum, the next line is player id, stage of
quest, timestamp, respectively.
Pay attention the the stage, it's 7.

I'm reading it in like this:
fscanf(fp, "%ld %03i %ld\n", &id, &stage, &start)

Pretty basic stuff.  I noticed an inconsitency, and started debugging, let
me show you what I'm seeing.
The text file above is how it is right now.
Check this:
5550                     fscanf(fp, "%ld", &mvnum);
(gdb)
5552                            if (fscanf(fp, "%ld %03i %ld\n", &id,
&stage, &start) == EOF){
(gdb) print id
$1 = 956375612
(gdb) print stage
$2 = 7
(gdb) print start
$3 = 1015018986
Looks good to me.

Okay, i overwrite the 007 with 008, the file looks like this:
150845
956375612 008 1015018986

Look at the following gdb output:
5550                     fscanf(fp, "%ld", &mvnum);
(gdb)
5552                            if (fscanf(fp, "%ld %03i %ld\n", &id,
&stage, &start) == EOF){
(gdb) print id
$4 = 956375612
(gdb) print stage
$5 = 0
(gdb) print start
$6 = 8

Something here is not right.  Ideas?
id, and start are longs.
stage is an int. 
Not that it helps that much.




Reply via email to