keyval_parse.c: update whitespace/comments
Slightly improve comments and update some whitespace. No code or logic changes. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Этот коммит содержится в:
родитель
eac0ab5c3a
Коммит
8ed1d28fb4
@ -287,22 +287,25 @@ static int add_to_env_str(char *var, char *val)
|
||||
varsz = strlen(var);
|
||||
if (NULL != val) {
|
||||
valsz = strlen(val);
|
||||
/* account for '=' */
|
||||
/* If we have a value, it will be preceeded by a '=', so be
|
||||
sure to account for that */
|
||||
valsz += 1;
|
||||
}
|
||||
sz = 0;
|
||||
if (NULL != env_str) {
|
||||
sz = strlen(env_str);
|
||||
/* account for ';' */
|
||||
/* If we have a valid variable, the whole clause will be
|
||||
terminated by a ';', so be sure to account for that */
|
||||
sz += 1;
|
||||
}
|
||||
/* add required new size incl NUL byte */
|
||||
sz += varsz+valsz+1;
|
||||
/* Sum the required new sizes, including space for a terminating
|
||||
\0 byte */
|
||||
sz += varsz + valsz + 1;
|
||||
|
||||
/* make sure we have sufficient space */
|
||||
/* Make sure we have sufficient space */
|
||||
new_envsize = envsize;
|
||||
while (new_envsize <= sz) {
|
||||
new_envsize *=2;
|
||||
new_envsize *= 2;
|
||||
}
|
||||
|
||||
if (NULL != env_str) {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user