TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: THE NATURAL PHILOSOPHER
from: JASEN BETTS
date: 2019-02-25 20:16:00
subject: Re: C is not a low level

On 2019-02-24, The Natural Philosopher  wrote:
> On 24/02/2019 20:47, Jasen Betts wrote:
>> On 2019-02-24, The Natural Philosopher  wrote:
>>> On 24/02/2019 13:09, Richard Heathfield wrote:
>>>> If you take the trouble to ensure that you have enough space for your
>>>> data, there's nothing wrong with using str.
>>>
>>> c=malloc(strlen(str)+1);
>>> if(c)
>>>  strcpy (c,str);
>>>
>>> or
>>>
>>> c=stdup(str);
>>>
>>> ....
>>>
>>> free (c);
>>
>>
>> or alloc_sprintf(....  but someone cross-posted this to windows newsgroups.
>>
>
> never heard of that one.....thats not in stdlib...
>

I meant asprintf (which is a GNU extension) and available on raspberry-pi
(if running linux like most do) and ubuntu two of the six news-groups
this troll thread was posted to.  Glib provides g_strdup_sprintf which
is the same sort of thing.

--
  When I tried casting out nines I made a hash of it.

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.