projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 2.7
[ossec-hids.git]
/
src
/
os_xml
/
os_xml_access.c
diff --git
a/src/os_xml/os_xml_access.c
b/src/os_xml/os_xml_access.c
index
61ed5cd
..
5a6d529
100755
(executable)
--- a/
src/os_xml/os_xml_access.c
+++ b/
src/os_xml/os_xml_access.c
@@
-26,7
+26,7
@@
char **_GetElementContent(OS_XML *_lxml, char **element_name, char *attr);
/* OS_ElementExist: v1.0: 2005/02/26
/* OS_ElementExist: v1.0: 2005/02/26
- * Check if a element exists
+ * Check if a element exists
* The element_name must be NULL terminated (last char)
*/
int OS_ElementExist(OS_XML *_lxml, char **element_name)
* The element_name must be NULL terminated (last char)
*/
int OS_ElementExist(OS_XML *_lxml, char **element_name)
@@
-66,7
+66,7
@@
int OS_ElementExist(OS_XML *_lxml, char **element_name)
/* RootElementExist: v1.0: 2005/02/26
/* RootElementExist: v1.0: 2005/02/26
- * Check if a root element exists
+ * Check if a root element exists
*/
int OS_RootElementExist(OS_XML *_lxml, char *element_name)
{
*/
int OS_RootElementExist(OS_XML *_lxml, char *element_name)
{
@@
-201,7
+201,7
@@
char *OS_GetOneContentforElement(OS_XML *_lxml, char **element_name)
{
uniqret = ret[0];
}
{
uniqret = ret[0];
}
-
+
/* Freeing memory */
while(ret[i])
{
/* Freeing memory */
while(ret[i])
{
@@
-210,7
+210,7
@@
char *OS_GetOneContentforElement(OS_XML *_lxml, char **element_name)
i++;
}
free(ret);
i++;
}
free(ret);
-
+
return(uniqret);
}
return(uniqret);
}
@@
-242,7
+242,7
@@
char **OS_GetContents(OS_XML *_lxml, char **element_name)
/* OS_GetAttributeContent: v0.1: 2005/03/01
/* OS_GetAttributeContent: v0.1: 2005/03/01
- * Get one value for a specific attribute
+ * Get one value for a specific attribute
*/
char *OS_GetAttributeContent(OS_XML *_lxml, char **element_name,
char *attribute_name)
*/
char *OS_GetAttributeContent(OS_XML *_lxml, char **element_name,
char *attribute_name)
@@
-279,7
+279,7
@@
char *OS_GetAttributeContent(OS_XML *_lxml, char **element_name,
}
if(success)
return(uniqret);
}
if(success)
return(uniqret);
-
+
return(NULL);
}
return(NULL);
}
@@
-312,7
+312,7
@@
char **_GetElementContent(OS_XML *_lxml, char **element_name, char *attr)
}
i = _lxml->fol;
}
}
i = _lxml->fol;
}
- else
+ else
{
i = 0;
}
{
i = 0;
}
@@
-326,7
+326,7
@@
char **_GetElementContent(OS_XML *_lxml, char **element_name, char *attr)
if(matched !=1)
break;
}
if(matched !=1)
break;
}
-
+
/* Setting maximum depth of 16. */
if(j > 16)
return(NULL);
/* Setting maximum depth of 16. */
if(j > 16)
return(NULL);
@@
-352,7
+352,7
@@
char **_GetElementContent(OS_XML *_lxml, char **element_name, char *attr)
}
}
}
}
-
+
/* If the element name matches what we are looking for. */
else if(strcmp(_lxml->el[i], element_name[j]) == 0)
{
/* If the element name matches what we are looking for. */
else if(strcmp(_lxml->el[i], element_name[j]) == 0)
{
@@
-372,7
+372,7
@@
char **_GetElementContent(OS_XML *_lxml, char **element_name, char *attr)
{
break;
}
{
break;
}
-
+
if(strcmp(attr, _lxml->el[k]) == 0)
{
i = k;
if(strcmp(attr, _lxml->el[k]) == 0)
{
i = k;
@@
-389,7
+389,7
@@
char **_GetElementContent(OS_XML *_lxml, char **element_name, char *attr)
{
return(NULL);
}
{
return(NULL);
}
-
+
/* Adding new entry. */
ret[k] = strdup(_lxml->ct[i]);
ret[k + 1] = NULL;
/* Adding new entry. */
ret[k] = strdup(_lxml->ct[i]);
ret[k + 1] = NULL;
@@
-398,15
+398,15
@@
char **_GetElementContent(OS_XML *_lxml, char **element_name, char *attr)
free(ret);
return(NULL);
}
free(ret);
return(NULL);
}
-
+
matched = 1;
k++;
matched = 1;
k++;
-
+
if(attr != NULL)
{
if(attr != NULL)
{
- break;
+ break;
}
}
-
+
else if(_lxml->fol != 0)
{
_lxml->fol = i+1;
else if(_lxml->fol != 0)
{
_lxml->fol = i+1;
@@
-429,7
+429,7
@@
char **_GetElementContent(OS_XML *_lxml, char **element_name, char *attr)
matched = 0;
}
}
matched = 0;
}
}
-
+
if(ret == NULL)
return(NULL);
if(ret == NULL)
return(NULL);