On Mon, Jun 18, 2018 at 2:17 AM Huw Davies huw@codeweavers.com wrote:
On Sun, Jun 17, 2018 at 11:38:10PM -0600, Alex Henrie wrote:
+static void get_smbios_string(const char *path, char *s, size_t *len) +{
- FILE *file = fopen(path, "r");
- if (!file)
- {
*len = 0;
return;
- }
- *len = fread(s, 1, 127, file);
You could pass the size of the buffer using len as an [in,out] parameter, then you wouldn't need the magic number.
Let's just make it a #define.
-Alex