🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3762

Re: gets() and getchar

#3762
From: Jeremy Fitzhardinge
Date: Thu, 17 Aug 1995 08:57
21 lines
1525 bytes
In <1995Aug15.121547.11587@friend.kastle.com> rich@kastle.com (Richard Krehbiel) writes:
>Are we wishing for new standard library functions?  I have some string
>library peeves that new functions would satisfy nicely:

Me too.  Does anyone use the fact that strcpy returns the first argument?

Invariably, when I want strcpy to return something, I want it to return
a pointer the '\0' at the end of the destination string it's just written.
I end up having to either "know" the length of the string, or use strlen
on the result to find the end, or use my own strcpy which returns a more
useful thing.

I realize that people *do* use the existing of strcpy in macros and so on,
but it's hardly generally useful.

Ideally strcpy could be updated to the new behaviour, and all the code
which depends on the old code will magically fix itself.  I guess in the
absence of such sufficiently advanced technology, it could only be fixed
with a new function, which is hardly appealing.

	J
Technical Details
Message-ID: <jeremy.808649850@suede.sw.oz.au>
Path: arc1-ca.pugleaf.net!swallow.sw.oz.au!jeremy
References: <Pine.ULT.3.91.950807194041.19202A-100000@mars> <40bqih$bft@caip.rutgers.edu> <1995Aug11.002333.20047@dcs.warwick.ac.uk> <40fn05$686@kruuna.helsinki.fi> <40fng8$7ep@kruuna.helsinki.fi> <1995Aug15.121547.11587@friend.kastle.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!swallow.sw.oz.au!jeremy
From: jeremy@sw.oz.au (Jeremy Fitzhardinge)
Newsgroups: comp.std.c
Subject: Re: gets() and getchar
Date: 17 Aug 95 08:57:30 GMT
Organization: Softway Pty Limited
Message-ID: <jeremy.808649850@suede.sw.oz.au>
References: <Pine.ULT.3.91.950807194041.19202A-100000@mars> <40bqih$bft@caip.rutgers.edu> <1995Aug11.002333.20047@dcs.warwick.ac.uk> <40fn05$686@kruuna.helsinki.fi> <40fng8$7ep@kruuna.helsinki.fi> <1995Aug15.121547.11587@friend.kastle.com>
NNTP-Posting-Host: suede.sw.oz.au