Greetings and salutations,
First time posting; have a quick question for you. I use Erwin's note
board system. I was going to make a note formatter
for it, but then I noticed that OLC had a formatter built in, called
format_string:
char *format_string (char *oldstring)
I figured I could kind of make use of this and use that instead of making my
own line formatter, so this is what I did in
void handle_con_note_finish (part of board.c):
case 'o': /*format note*/
ch->pcdata->in_progress->text = format_string
(ch->pcdata->in_progress->text);
write_to_buffer (d,"Note formatted.\n\r",0);
break;
Now, here's my question-- some of the other calls to format_string use
pointers, like
*ch->desc->pString = format_string (*ch->desc->pString);
while others do not, like
pRoom->description = format_string (pRoom->description);
I was wondering if I am making a _TERRIBLE_ mistake by somehow sending
non-pointed type stuff to format_string,
which uses pointers. (As you can obviously tell, I'm not exactly the
world's most competent C programmer, verily).
Is passing the note text like that fine? No bad juju with memory being
scrambled or anything? I tried it out with much suspense,
and it appears to be okay--no compiler warnings on the make, and the box
we're on still seems stable after making a few notes.
(Obviously you can tell pointers to me are something similar to
superstition).
I appreciate any explanation you may be able to provide on how this works.
Thank you very much for reading,
Jeremy Hill / Evangelion