Re: [World Editors] Dikued

From: George (greerga@CIRCLEMUD.ORG)
Date: 03/16/98


On Mon, 16 Mar 1998, AxL wrote:

>        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';

You could try (mailer code):

#define read_line(fd, len, buf) (buf)[strlen(fgets(fd, len, buf)) - 1] = '\0'

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~greerga | is not thus handicapped. -- Elbert Hubbard


     +------------------------------------------------------------+
     | 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