FACT++
1.0
Main Page
Related Pages
Namespaces
Classes
Files
Examples
int dim_get_env_var
(
char *
env_var
,
char *
value
,
int
len
)
Definition at line
227
of file
utilities.c
.
228
{
229
char
*p;
230
int
tot, sz;
231
232
if
( (p = getenv(env_var)) == NULL )
233
return
(0);
234
else
{
235
tot = (int)strlen(p)+1;
236
if
(value != 0)
237
{
238
sz = tot;
239
if
(sz > len)
240
sz = len;
241
strncpy(value, p, (
size_t
)sz);
242
if
((sz == len) && (len > 0))
243
value[sz-1] =
'\0'
;
244
}
245
return
(tot);
246
}
247
}
dim
src
utilities.c
Generated on Sun Sep 18 2016 20:50:32 for FACT++ by
1.8.11