need help removing string properly from kernel code

February 1, 2014 at 20:05:35
Specs: linux
// drivers/target/core_arget_device.c

buf[7] = 0x2; /* CmdQue=1 */

memcpy(&buf[8], "LlO-ORG ", 8);
memset(&buf[16], 0x20, 16);
// trying to remove model & revision, but am not very sure how to do this correctly
memcpy(&buf[16], dev->t10_wwn.model,
min_t(size_t, strlen(dev->t10_wwn.model), 16));
memcpy(&buf[32], dev->t10_wwn.revision,
min_t(size_t, strlen(dev->t10_wwn.revision), 4));
buf[4] = 31; /* Set additional length to 31 */


i would like to just comment out:
memcpy(&buf[16], dev->t10_wwn.model,
min_t(size_t, strlen(dev->t10_wwn.model), 16));
memcpy(&buf[32], dev->t10_wwn.revision,
min_t(size_t, strlen(dev->t10_wwn.revision), 4));

but what i don't understand is what buf and memset do and if they have any implications.

so currently it shows as "LlO-ORG model revision" but i want it to show only as "LlO-ORG"

.

message edited by biatche


See More: need help removing string properly from kernel code

Report •


#1
February 3, 2014 at 11:09:24
Really, if you're going to take something and rebrand it as your own, you really should at least know the basics of the language it was written in.
http://www.cplusplus.com/reference/...

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question