linux - Working with strings in C that contain multiple Null characters -
I have a I need to take action on this string and discover and replace some content. For this, I would like to use I tried to change the tap with a character in buffer from which I thought this (Bell ASCII code \ 7) will not appear and then process it, but it does not work and my Contambs the data. code> memmem used to do this However, since your data is embedded in the null, you can not use the char [] buffer that contains data from memory, which means Many tap inside this buffer and not only finally a single terminating faucet.
char * addr = (four *) memmem (buff, strlen (buff), needle, strlen (needle));
memmem () , but unfortunately, this is not working because many tap inside buffer.
strlen to calculate the length. You need to keep track of different lengths.
four * addr = (four *) memmem (buff, buffet, needle, needle lan);
Comments
Post a Comment