Hi. I have some code to get the vendor string from a CPU, but I don't want the function (see below) to print anything. I want to put the string in my struct (also below), so I tried using strcpy but it caused a segfault, as did memmov.
Did you check that it's returning something meaningful? Functions with a return type return garbage when an execution path doesn't have a return statement.
The getManufacturer function returned 'Intel' on my CPU.
It's when I try to memmove/strcpy vstring or manufacturer into the struct that I get a segfault.
I don't want that function doing output because its meant to do a job and return a value in the same way strcmp doesn't do output, it just works away silently.
Are you aware of the fact that "cpu" is not initialized? If you try to copy something into an area referenced by "cpu" then there's no suprise that you get the error.