Changeset 1019
- Timestamp:
- Jan 22, 2004, 4:11:28 AM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/app/setenv.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1018 r1019 18 18 #include <emx/time.h> /* _tzset_flag */ 19 19 20 20 21 21 /** 22 22 * Set environment variable. … … 26 26 * @param envname Name of environment variable to set. 27 27 * Shall not be NULL, empty string or contain '='. 28 * @param envval The value to set. 28 * @param envval The value to set. 29 29 * @param overwrite If set any existing variable should be overwritten. 30 * If clear return successfully without changing any 30 * If clear return successfully without changing any 31 31 * existing variable. 32 * If there is not existing variable it is added 32 * If there is not existing variable it is added 33 33 * regardless of the state of this flag. 34 34 * @author knut st. osmundsen <bird-srcspam@anduin.net> … … 55 55 56 56 /* search for existing variable iinstance */ 57 lenname = strlen (envname); 57 lenname = strlen (envname); 58 58 p = environ; 59 59 env_size = 0; … … 86 86 { 87 87 p = malloc ((env_size+2) * sizeof (char *)); 88 if (p == NULL) 88 if (p == NULL) 89 89 return -1; 90 90 environ = p; … … 95 95 { 96 96 p = realloc (environ, (env_size+2) * sizeof (char *)); 97 if (p == NULL) 97 if (p == NULL) 98 98 return -1; 99 99 environ = p; … … 107 107 /* Allocate space for new variable and assign it. */ 108 108 *p = malloc(lenname + lenval + 2); 109 if ( *p)109 if (!*p) 110 110 return -1; 111 111 memcpy(*p, envname, lenname); -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.