[World Editors] Dikued

From: AxL (axl@MINDWARP.PLYMOUTH.EDU)
Date: 03/16/98


        A recent project I have decided to do is take the old Dikued
offline world editing program, and fix it up a bit.  The program makes
use of the gets() function, which nearly every C sourse has told me is
a Bad Thing(tm), and to use fgets() instead.
        That is all fine, but what fgets() does that gets() does not is
read in the newline along with the user input, which would make a mess
of putting ~'s in the right place, etc...
        So is there another fuction that could be used instead?  fgets()
will work fine if I strip the newline char after every input, but that
is in a LOT of places in the code. :)  Any comments/critiques would
be much valued. :)  The call I make to fgets() looks like this, if that
is of importance:

fgets(wstr, RE_MAXSTRLEN, stdin);

        A simple thing to strip the newline is below, but if there's an
alternate to putting that after every fgets() call for user input, I'd
like to know. :)

if (*wstr2)
   wstr2[strlen(wstr2) - 1] = '\0';

--
-AxL, axl@wpcr.plymouth.edu - SysOp, RPM Director, WPCR Plymouth, 91.7 FM
 "Discriminate against the next fashion sucker you meet....it's a raver!"
                                      - Ec8or,  Digital Hardcore Records


     +------------------------------------------------------------+
     | 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/15/00 PST