Hugh McMaster hugh.mcmaster@outlook.com writes:
+static WCHAR *get_line(struct reg_info *reg_info) +{
- WCHAR *line;
- if (!reg_info->is_unicode)
- {
char *lineA = get_lineA(reg_info->file);
line = GetWideString(lineA);
- }
- else
- {
line = get_lineW(reg_info->file);
- }
- return line;
+}
That's fairly ugly. If you want to use common code, you should probably pass a function pointer for getting lines. Also you'd have to do it in a way that doesn't require freeing the buffer.