Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
420ce563
Commit
420ce563
authored
Aug 10, 2009
by
Uwe Schulzweida
Browse files
vlist_def_att: overwrite attr if allready exist
parent
7ff48588
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/vlist_att.c
View file @
420ce563
...
...
@@ -76,6 +76,7 @@ CDI_att *new_att(CDI_atts *attsp, const char *name)
attp
->
name
=
(
char
*
)
malloc
(
slen
+
1
);
memcpy
(
attp
->
name
,
name
,
slen
+
1
);
attp
->
namesz
=
slen
;
attp
->
xvalue
=
NULL
;
return
(
attp
);
}
...
...
@@ -94,7 +95,7 @@ void fill_att(CDI_att *attp, int type, size_t nelems, size_t xsz, const void *xv
if
(
xsz
>
0
)
{
attp
->
xvalue
=
(
void
*
)
m
alloc
(
xsz
);
attp
->
xvalue
=
(
void
*
)
re
alloc
(
attp
->
xvalue
,
xsz
);
memcpy
(
attp
->
xvalue
,
xvalue
,
xsz
);
}
}
...
...
@@ -210,16 +211,12 @@ int vlist_def_att(int type, int vlistID, int varID, const char *name, size_t len
assert
(
attsp
!=
NULL
);
attp
=
find_att
(
attsp
,
name
);
if
(
attp
!=
NULL
)
/* name in use */
{
}
else
{
attp
=
new_att
(
attsp
,
name
);
if
(
attp
!=
NULL
)
fill_att
(
attp
,
type
,
len
,
xsz
,
xp
);
}
if
(
attp
==
NULL
)
attp
=
new_att
(
attsp
,
name
);
if
(
attp
!=
NULL
)
fill_att
(
attp
,
type
,
len
,
xsz
,
xp
);
return
(
status
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment