Recently I saw a code that initilizes a struct using {0} .My question is if this works for all elements of the struct or just the 1st one. Example:
.H File:
typedef struct
{
UINT32 size;
UINT16 num1;
UINT8 * p_buffer;
} MY_RECORD;
--------------
.C File:
...
MY_RECORD...
Explanation for "> the mem corruption cannot be avoided/detected in this scenario":
- There is a 3rd party sw compononent that is sending messages to the code portion which I've mentioned that is doing the strlen. The code for the 3rd party sw compononent cannot be accessed so the assumption is...
Hi Salem,
the mem corruption cannot be avoided/detected in this scenario and what I want to do is to protect other portion of code with this mechanism. I am trying to use "strstr" command to look for a "\0" so if it does not find any then the strlen should never be executed.
BTCMan
Hi,
I would like your expertise in order to protect my code for strings without the \0 terminator (in case of memory corruption). Currently the code is failing because when it invokes strlen for a string with trash in it it never finds the \0 terminator then returns the size of the datatype...
Hi all,
does anybody knows how to convert an org.w3c.dom.Document into a String ?? (basically I want to log the dom tree into a string object not a file). Thanks
BTCMan
Hi,
I would like suggestions on how to open a Directory only Browser Dialog (I mean: only folders are listed and one of them can be selected). I was trying to use JFileChooser with setFileSelectionMode set to DIRECTORIES_ONLY, but this was not I was looking for (I want to avoid the window to...
Hi guys,
I would like to read a node with all its contents from a DOM tree and insert it in a new DOM. Any hint? Below is my dom tree format (already in memory as a dom tree) and the expected result:
MEMORY DOM:
<?xml version="1.0" encoding="UTF-8"?>
<Oper>...
I solved this issue. Code below for reference:
Initial state:
operDom -> Document object with a DOM tree
-------------------------------------------
public Document appendDoms(Document operDom) {
Document joinDom = null;
// Creates a new DOM tree to hold the join result
joinDom =...
Hi people,
I have a List object with "n" different DOM trees (each element of the List object has a Document object).
I want to create a new DOM tree object and insert in it each one of the "n" DOM trees I have in the saved List. So the final result will be a single DOM.
Any hint of code...
Actually I need Java code. By the way I made some tests using the code below and it works. The negative point is performance since I need to run the whole DOM tree checking each node:
private List subTemplatePathList = new ArrayList();
public List getSubTemplatePathFromOperationalTemplate...
Hi,
I have the following XML:
...
<aaa>
<bb>
<ccTemplate>../dir1/dir2/file3.xml</ccTemplate>
<dd>
</dd>
</bb>
<ee>
</ee>
<ff>
<gg>
<hhTemplate>../dir1/dir2/file4.xml</hhTemplate>
</gg>
</ff>
</aaa>
This XML file is parsed into a DOM tree Document. How do I...
Ok with the split method but before call it we need to remove undesired "(" and ")". I would like to see a single regular expression that retrieves the desired data.
Thanx
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.