I am testing following peace of code for possible Endian issue. Code was written for ppc and needs to be run on x86 box now.
string Mac = nodeMessage->getMac();
char mac_string[17];
strncpy(mac_string, Mac.c_str(),16);
I am testing following peace of code for possible Endian issue. Code was written for ppc and needs to be run on x86 box now.
string Mac = nodeMessage->getMac();
char mac_string[17];
strncpy(mac_string, Mac.c_str(),16);
Endian-ness of a machine affects integral values that are more than one byte wide. I don't see any integral values there. Hence, I don't see any Endian-ness problems associated with the above code.
If you are dealing only with 1 byte chars(ASCII) then its Endian safe else its not.
the following link may be helpful.
Completing the answer of R Sahu, the problem could be the nodeMessage
and how it manages the mac (I suppose that it refers to a mac address).