Re: [QUESTION] toupper problems 09:03:38 -0500"

From: d. hall (dhall@APK.NET)
Date: 12/12/97


: thus on Fri, 12 Dec 1997 09:03:38 -0500, Ryan virtually wrote:

Ryan> I am trying to take an argument, buf2, toupper it, and then copy that
Ryan> into a char pointer like so: *choice = toupper(*buf2); I have added
Ryan> log comments in every step of my code, and it does not get by this
Ryan> line. Is this valid code on *Nix box? I made a sample program that
Ryan> did the same thing with MSVC 5.0 and had no problems. It copied over
Ryan> fine, but crashes on my BSD machine with a Seg fault. If this is Ok,
Ryan> then why doesn't the log file log my next comment right after it?

Let's start with obvious and move down.

Is choice a pointer to a char?
Does choice actually point to a valid char array (string?)?
Does choice pointer to a const char array?

seg fault normally means you're writing to memory you haven't alloc'ed.

It's normally easier running your server in a debugger, or if that's not
possible, run a stack trace on the core file.

d.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST