[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Requesting help with C extension
- From: Andrew Gierth <andrew@...>
- Date: Fri, 20 Jul 2018 07:07:12 +0100
>>>>> "Simon" == Simon Wunderlin <swunderlin@gmail.com> writes:
Simon> For my application to work I need to set environment variables.
Simon> Therefore I have written a simple Lua C extensions to do so:
Simon> https://pastebin.com/NsNMHkUu
putenv() is dangerous; if your OS has setenv() you should use that
instead.
The problem with putenv() is that it does not copy the supplied string,
it just puts a pointer to it into the environment. setenv(), in
contrast, makes a copy of the supplied string.
--
Andrew.